Exemplo n.º 1
0
	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();
	}
Exemplo n.º 2
0
 //-----------------------------------------------------------------------
 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();
 }
 //-----------------------------------------------------------------------
 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();
 }
	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( "'" );
	}
Exemplo n.º 5
0
    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();
    }