diff --git a/include/fc/log/console_appender.hpp b/include/fc/log/console_appender.hpp index 9fe9f30..ddc54f2 100644 --- a/include/fc/log/console_appender.hpp +++ b/include/fc/log/console_appender.hpp @@ -1,6 +1,7 @@ #pragma once #include #include +#include namespace fc { @@ -41,7 +42,7 @@ namespace fc fc::string format; console_appender::stream::type stream; - fc::vector level_colors; + std::vector level_colors; bool flush; }; diff --git a/include/fc/log/log_message.hpp b/include/fc/log/log_message.hpp index c632cc6..4a6257a 100644 --- a/include/fc/log/log_message.hpp +++ b/include/fc/log/log_message.hpp @@ -127,7 +127,7 @@ namespace fc void to_variant( const log_message& l, variant& v ); void from_variant( const variant& l, log_message& c ); - typedef fc::vector log_messages; + typedef std::vector log_messages; } // namespace fc diff --git a/include/fc/log/logger_config.hpp b/include/fc/log/logger_config.hpp index c46accc..b31fefe 100644 --- a/include/fc/log/logger_config.hpp +++ b/include/fc/log/logger_config.hpp @@ -21,16 +21,16 @@ namespace fc { bool enabled; /// if any appenders are sepecified, then parent's appenders are not set. bool additivity; - fc::vector appenders; + std::vector appenders; logger_config& add_appender( const string& s ); }; struct logging_config { static logging_config default_config(); - fc::vector includes; - fc::vector appenders; - fc::vector loggers; + std::vector includes; + std::vector appenders; + std::vector loggers; }; void configure_logging( const fc::path& log_config ); diff --git a/include/fc/variant.hpp b/include/fc/variant.hpp index 896a79d..cf4e64e 100644 --- a/include/fc/variant.hpp +++ b/include/fc/variant.hpp @@ -1,8 +1,9 @@ #pragma once -#include +#include #include #include #include +#include // memset namespace fc { @@ -35,8 +36,8 @@ namespace fc void from_variant( const variant& var, variant_object& vo ); void to_variant( const mutable_variant_object& var, variant& vo ); void from_variant( const variant& var, mutable_variant_object& vo ); - void to_variant( const vector& var, variant& vo ); - void from_variant( const variant& var, vector& vo ); + void to_variant( const std::vector& var, variant& vo ); + void from_variant( const variant& var, std::vector& vo ); void to_variant( const time_point& var, variant& vo ); void from_variant( const variant& var, time_point& vo ); #ifdef __APPLE__ @@ -50,7 +51,7 @@ namespace fc template void from_variant( const variant& var, std::shared_ptr& vo ); - typedef vector variants; + typedef std::vector variants; /** * @brief stores null, int64, uint64, double, bool, string, vector, @@ -246,7 +247,7 @@ namespace fc /** @ingroup Serializable */ template - void from_variant( const variant& var, vector& tmp ) + void from_variant( const variant& var, std::vector& tmp ) { const variants& vars = var.get_array(); tmp.clear(); @@ -257,9 +258,9 @@ namespace fc /** @ingroup Serializable */ template - void to_variant( const vector& t, variant& v ) + void to_variant( const std::vector& t, variant& v ) { - vector vars(t.size()); + std::vector vars(t.size()); for( size_t i = 0; i < t.size(); ++i ) vars[i] = variant(t[i]); v = vars; diff --git a/include/fc/variant_object.hpp b/include/fc/variant_object.hpp index a5942ce..735e69f 100644 --- a/include/fc/variant_object.hpp +++ b/include/fc/variant_object.hpp @@ -43,7 +43,7 @@ namespace fc variant _value; }; - typedef vector< entry >::const_iterator iterator; + typedef std::vector< entry >::const_iterator iterator; /** * @name Immutable Interface @@ -69,7 +69,7 @@ namespace fc template variant_object( string key, T&& val ) - :_key_value( std::make_shared >() ) + :_key_value( std::make_shared >() ) { *this = variant_object( move(key), variant(forward(val)) ); } @@ -86,7 +86,7 @@ namespace fc variant_object& operator=( const mutable_variant_object& ); private: - std::shared_ptr< vector< entry > > _key_value; + std::shared_ptr< std::vector< entry > > _key_value; friend class mutable_variant_object; }; /** @ingroup Serializable */ @@ -112,8 +112,8 @@ namespace fc /** @brief a key/value pair */ typedef variant_object::entry entry; - typedef vector< entry >::iterator iterator; - typedef vector< entry >::const_iterator const_iterator; + typedef std::vector< entry >::iterator iterator; + typedef std::vector< entry >::const_iterator const_iterator; /** * @name Immutable Interface @@ -181,7 +181,7 @@ namespace fc template explicit mutable_variant_object( T&& v ) - :_key_value( new vector() ) + :_key_value( new std::vector() ) { *this = variant(fc::forward(v)).get_object(); } @@ -192,7 +192,7 @@ namespace fc mutable_variant_object( string key, variant val ); template mutable_variant_object( string key, T&& val ) - :_key_value( new vector() ) + :_key_value( new std::vector() ) { set( move(key), variant(forward(val)) ); } @@ -205,7 +205,7 @@ namespace fc mutable_variant_object& operator=( const mutable_variant_object& ); mutable_variant_object& operator=( const variant_object& ); private: - std::unique_ptr< vector< entry > > _key_value; + std::unique_ptr< std::vector< entry > > _key_value; friend class variant_object; }; /** @ingroup Serializable */ diff --git a/include/fc/vector.hpp b/include/fc/vector.hpp index 9220777..bb43f62 100644 --- a/include/fc/vector.hpp +++ b/include/fc/vector.hpp @@ -3,7 +3,15 @@ #include #include #include +#include +namespace fc +{ + template + using vector = std::vector; +} + +#if 0 namespace fc { namespace detail { @@ -400,3 +408,4 @@ namespace fc { }; +#endif diff --git a/src/crypto/base58.cpp b/src/crypto/base58.cpp index aeffe3f..f86a983 100644 --- a/src/crypto/base58.cpp +++ b/src/crypto/base58.cpp @@ -609,12 +609,12 @@ fc::string to_base58( const char* d, size_t s ) { return EncodeBase58( (const unsigned char*)d, (const unsigned char*)d+s ).c_str(); } -fc::vector from_base58( const fc::string& base58_str ) { +std::vector from_base58( const fc::string& base58_str ) { std::vector out; if( !DecodeBase58( base58_str.c_str(), out ) ) { FC_THROW_EXCEPTION( exception, "Unable to decode base58 string ${base58_str}", ("base58_str",base58_str) ); } - return fc::vector((const char*)out.data(), ((const char*)out.data())+out.size() ); + return std::vector((const char*)out.data(), ((const char*)out.data())+out.size() ); } /** * @return the number of bytes decoded diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp index 0e4526e..63b38cc 100644 --- a/src/crypto/sha256.cpp +++ b/src/crypto/sha256.cpp @@ -85,11 +85,11 @@ namespace fc { void to_variant( const sha256& bi, variant& v ) { - v = fc::vector( (const char*)&bi, ((const char*)&bi) + sizeof(bi) ); + v = std::vector( (const char*)&bi, ((const char*)&bi) + sizeof(bi) ); } void from_variant( const variant& v, sha256& bi ) { - fc::vector ve = v.as< vector >(); + std::vector ve = v.as< std::vector >(); if( ve.size() ) { memcpy(&bi, ve.data(), fc::min(ve.size(),sizeof(bi)) ); diff --git a/src/crypto/sha512.cpp b/src/crypto/sha512.cpp index 0c598c5..d177fe3 100644 --- a/src/crypto/sha512.cpp +++ b/src/crypto/sha512.cpp @@ -89,11 +89,11 @@ namespace fc { void to_variant( const sha512& bi, variant& v ) { - v = fc::vector( (const char*)&bi, ((const char*)&bi) + sizeof(bi) ); + v = std::vector( (const char*)&bi, ((const char*)&bi) + sizeof(bi) ); } void from_variant( const variant& v, sha512& bi ) { - fc::vector ve = v.as< vector >(); + std::vector ve = v.as< std::vector >(); if( ve.size() ) { memcpy(&bi, ve.data(), fc::min(ve.size(),sizeof(bi)) ); diff --git a/src/network/resolve.cpp b/src/network/resolve.cpp index ec6b159..f5cbaf8 100644 --- a/src/network/resolve.cpp +++ b/src/network/resolve.cpp @@ -3,10 +3,10 @@ namespace fc { - fc::vector resolve( const fc::string& host, uint16_t port ) + std::vector resolve( const fc::string& host, uint16_t port ) { auto ep = fc::asio::tcp::resolve( host, std::to_string(uint64_t(port)) ); - fc::vector eps; + std::vector eps; eps.reserve(ep.size()); for( auto itr = ep.begin(); itr != ep.end(); ++itr ) eps.push_back( fc::ip::endpoint(itr->address().to_v4().to_ulong(), itr->port()) ); diff --git a/src/variant.cpp b/src/variant.cpp index 90e4cf7..8adab43 100644 --- a/src/variant.cpp +++ b/src/variant.cpp @@ -14,16 +14,16 @@ namespace fc void to_variant( const uint16_t& var, variant& vo ) { vo = uint64_t(var); } // TODO: warn on overflow? void from_variant( const variant& var, uint16_t& vo ){ vo = static_cast(var.as_uint64()); } -void to_variant( const vector& var, variant& vo ) +void to_variant( const std::vector& var, variant& vo ) { if( var.size() ) vo = variant(base64_encode((unsigned char*)var.data(),var.size())); else vo = ""; } -void from_variant( const variant& var, vector& vo ) +void from_variant( const variant& var, std::vector& vo ) { std::string b64 = base64_decode( var.as_string() ); - vo = fc::vector( b64.c_str(), b64.c_str() + b64.size() ); + vo = std::vector( b64.c_str(), b64.c_str() + b64.size() ); } /** * The TypeID is stored in the 'last byte' of the variant. diff --git a/src/variant_object.cpp b/src/variant_object.cpp index 6f5428e..f3cb488 100644 --- a/src/variant_object.cpp +++ b/src/variant_object.cpp @@ -96,12 +96,12 @@ namespace fc } variant_object::variant_object() - :_key_value(std::make_shared>() ) + :_key_value(std::make_shared>() ) { } variant_object::variant_object( string key, variant val ) - : _key_value(std::make_shared>()) + : _key_value(std::make_shared>()) { //_key_value->push_back(entry(fc::move(key), fc::move(val))); _key_value->emplace_back(entry(fc::move(key), fc::move(val))); @@ -116,12 +116,12 @@ namespace fc variant_object::variant_object( variant_object&& obj) : _key_value( fc::move(obj._key_value) ) { - obj._key_value = std::make_shared>(); + obj._key_value = std::make_shared>(); assert( _key_value != nullptr ); } variant_object::variant_object( const mutable_variant_object& obj ) - : _key_value(std::make_shared>(*obj._key_value)) + : _key_value(std::make_shared>(*obj._key_value)) { } @@ -153,7 +153,7 @@ namespace fc variant_object& variant_object::operator=( mutable_variant_object&& obj ) { _key_value = fc::move(obj._key_value); - obj._key_value.reset( new fc::vector() ); + obj._key_value.reset( new std::vector() ); return *this; } @@ -260,23 +260,23 @@ namespace fc } mutable_variant_object::mutable_variant_object() - :_key_value(new fc::vector) + :_key_value(new std::vector) { } mutable_variant_object::mutable_variant_object( string key, variant val ) - : _key_value(new fc::vector()) + : _key_value(new std::vector()) { _key_value->push_back(entry(fc::move(key), fc::move(val))); } mutable_variant_object::mutable_variant_object( const variant_object& obj ) - : _key_value( new fc::vector(*obj._key_value) ) + : _key_value( new std::vector(*obj._key_value) ) { } mutable_variant_object::mutable_variant_object( const mutable_variant_object& obj ) - : _key_value( new fc::vector(*obj._key_value) ) + : _key_value( new std::vector(*obj._key_value) ) { }