⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 string_maker.h

📁 这是一个银行系统的管理软件
💻 H
字号:
/**********************************************************************************
*                                                                                 *
*  Copyright (c) 2003 - 2004 by Royal. All rights reserved.                       *
*                                                                                 *
*  Permission to use, copy, modify, and distribute this software for any purpose  *
*  is hereby granted without fee, provided that this copyright and permissions    *
*  notice appear in all copies and derivatives, and that no charge may be made    *
*  for the software and its documentation except to cover cost of distribution.   *
*                                                                                 *
*  This software is provided "as is" without express or implied warranty.         *
*                                                                                 *
**********************************************************************************/

/*
*  Description:
*
*    A helper class that implements function as "format" string.
*
*  History:
*
*    Initial version created by Royal, January 2003.
*
*  Notes:
*
*    This code has been written to conform to standard C++ and STL. It has been
*    compiled successfully using GNU C++ 3.2, Borland C++ 5.5, and Visual C++ 7.0.
*/

#ifndef STRING_MAKER_H
#define STRING_MAKER_H

#include <sstream>
#include <string>

namespace dragon
{

class String_maker
{
public:
    template <class T> 
    String_maker& operator << (const T& t) 
    { 
        osm_ << t; 
        return *this; 
    }        
    operator std::string () const 
    { 
        return osm_.str(); 
    }    
private:
    std::ostringstream osm_;
};

} // namespace dragon

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -