当前位置: 首页>>代码示例>>C++>>正文


C++ StringStream::width方法代码示例

本文整理汇总了C++中StringStream::width方法的典型用法代码示例。如果您正苦于以下问题:C++ StringStream::width方法的具体用法?C++ StringStream::width怎么用?C++ StringStream::width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringStream的用法示例。


在下文中一共展示了StringStream::width方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: toString

	String toString(UINT64 val, unsigned short width, char fill, std::ios::fmtflags flags)
	{
		StringStream stream;
		stream.width(width);
		stream.fill(fill);
		if (flags)
			stream.setf(flags);
		stream << val;
		return stream.str();
	}
开发者ID:MarcoROG,项目名称:BansheeEngine,代码行数:10,代码来源:BsString.cpp

示例2: toString

 //-----------------------------------------------------------------------
 String StringConverter::toString(double val, unsigned short precision,
                                  unsigned short width, char fill, std::ios::fmtflags flags)
 {
     StringStream stream;
     stream.precision(precision);
     stream.width(width);
     stream.fill(fill);
     if (flags)
         stream.setf(flags);
     stream << val;
     return stream.str();
 }
开发者ID:yiliu1203,项目名称:OGRE,代码行数:13,代码来源:OgreStringConverter.cpp

示例3: toString

 //-----------------------------------------------------------------------
 String StringConverter::toString(int val, 
     unsigned short width, char fill, std::ios::fmtflags flags)
 {
     StringStream stream;
     if (msUseLocale)
         stream.imbue(msLocale);
     stream.width(width);
     stream.fill(fill);
     if (flags)
         stream.setf(flags);
     stream << val;
     return stream.str();
 }
开发者ID:Ketzer2002,项目名称:meridian59-engine,代码行数:14,代码来源:OgreStringConverter.cpp

示例4: DoWriteBinary

	String CDatabaseConnectionMySql::DoWriteBinary( const ByteArray & array ) const
	{
		StringStream stream;
		stream.setf( std::ios::hex, std::ios::basefield );

		for ( auto && it = array.begin(); it != array.end(); ++it )
		{
			stream.width( 2 );
			stream.fill( STR( '0' ) );
			stream << int( *it );
		}

		return STR( "X'" ) + stream.str() + STR( "'" );
	}
开发者ID:DragonJoker,项目名称:DatabaseConnector,代码行数:14,代码来源:DatabaseConnectionMySql.cpp

示例5: _toString

    String StringConverter::_toString(T val, uint16 width, char fill, std::ios::fmtflags flags)
    {
        StringStream stream;
        stream.width(width);
        stream.fill(fill);
        if (flags & std::ios::basefield) {
            stream.setf(flags, std::ios::basefield);
            stream.setf((flags & ~std::ios::basefield) | std::ios::showbase);
        }
        else if (flags)
            stream.setf(flags);

        stream << val;

        return stream.str();
    }
开发者ID:yiliu1203,项目名称:OGRE,代码行数:16,代码来源:OgreStringConverter.cpp


注:本文中的StringStream::width方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。