peerplays-fc/include/fc/string.hpp

33 lines
1 KiB
C++
Raw Normal View History

2012-12-03 19:51:31 +00:00
#pragma once
#include <fc/fwd.hpp>
#include <fc/optional.hpp>
#include <string>
2019-04-04 11:46:38 +00:00
namespace fc
{
2019-04-04 11:46:38 +00:00
using std::string;
int64_t to_int64( const std::string& );
uint64_t to_uint64( const std::string& );
double to_double( const std::string& );
std::string to_string( double );
std::string to_string( uint64_t );
std::string to_string( int64_t );
std::string to_string( uint16_t );
2014-06-03 15:09:15 +00:00
std::string to_pretty_string( int64_t );
2019-04-04 11:46:38 +00:00
inline std::string to_string( int32_t v ) { return to_string( int64_t(v) ); }
inline std::string to_string( uint32_t v ){ return to_string( uint64_t(v) ); }
#ifdef __APPLE__
2019-04-04 11:46:38 +00:00
inline std::string to_string( size_t s) { return to_string(uint64_t(s)); }
#endif
2019-04-04 11:46:38 +00:00
typedef fc::optional<std::string> ostring;
class variant_object;
2019-04-04 11:46:38 +00:00
std::string format_string( const std::string&, const variant_object&, uint32_t max_object_depth = 200 );
std::string trim( const std::string& );
std::string to_lower( const std::string& );
2014-03-27 05:09:08 +00:00
string trim_and_normalize_spaces( const string& s );
2016-11-07 19:03:47 +00:00
uint64_t parse_size( const string& s );
}