2012-12-03 19:51:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
#include <fc/fwd.hpp>
|
2013-02-04 16:13:02 +00:00
|
|
|
#include <fc/optional.hpp>
|
2013-06-27 18:19:08 +00:00
|
|
|
#include <string>
|
2019-04-04 11:46:38 +00:00
|
|
|
|
2013-06-27 18:19:08 +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) ); }
|
2014-05-17 20:38:32 +00:00
|
|
|
#ifdef __APPLE__
|
2019-04-04 11:46:38 +00:00
|
|
|
inline std::string to_string( size_t s) { return to_string(uint64_t(s)); }
|
2014-05-17 20:38:32 +00:00
|
|
|
#endif
|
2013-06-27 18:19:08 +00:00
|
|
|
|
2019-04-04 11:46:38 +00:00
|
|
|
typedef fc::optional<std::string> ostring;
|
2013-06-27 18:19:08 +00:00
|
|
|
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 );
|
2013-06-27 18:19:08 +00:00
|
|
|
}
|