diff --git a/.travis.yml b/.travis.yml
index 2fed025..a8cf4fc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,7 +31,6 @@ script:
- set -o pipefail
- tests/run-parallel-tests.sh tests/all_tests
- "tests/api 2>&1 | grep -vE 'callback result 9|remote_calc->add. 4, 5 .: 9|set callback|] \\.$'"
- - tests/bip_lock 2>&1 | cat
- tests/hmac_test 2>&1 | cat
- tests/ecc_test README.md 2>&1 | cat
- tests/log_test 2>&1 | cat
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ebf8d16..1b62e3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,6 @@ SET( DEFAULT_LIBRARY_INSTALL_DIR lib/ )
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
SET( CMAKE_DEBUG_POSTFIX _debug )
SET( BUILD_SHARED_LIBS NO )
-SET( ECC_IMPL secp256k1 CACHE STRING "secp256k1 or openssl or mixed" )
set(platformBitness 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -37,17 +36,6 @@ SET(BOOST_COMPONENTS)
LIST(APPEND BOOST_COMPONENTS thread date_time filesystem system program_options chrono unit_test_framework context iostreams regex)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
-IF( ECC_IMPL STREQUAL openssl )
- SET( ECC_REST src/crypto/elliptic_impl_pub.cpp )
-ELSE( ECC_IMPL STREQUAL openssl )
- SET( ECC_LIB secp256k1 )
- IF( ECC_IMPL STREQUAL mixed )
- SET( ECC_REST src/crypto/elliptic_impl_priv.cpp src/crypto/elliptic_impl_pub.cpp )
- ELSE( ECC_IMPL STREQUAL mixed )
- SET( ECC_REST src/crypto/elliptic_impl_priv.cpp )
- ENDIF( ECC_IMPL STREQUAL mixed )
-ENDIF( ECC_IMPL STREQUAL openssl )
-
# Configure secp256k1-zkp
if ( MSVC )
# autoconf won't work here, hard code the defines
@@ -233,17 +221,12 @@ set( fc_sources
src/io/sstream.cpp
src/io/json.cpp
src/io/varint.cpp
- src/io/console.cpp
src/filesystem.cpp
src/interprocess/signals.cpp
src/interprocess/file_mapping.cpp
- src/interprocess/mmap_struct.cpp
- src/interprocess/file_mutex.cpp
src/rpc/cli.cpp
src/rpc/http_api.cpp
- src/rpc/json_connection.cpp
src/rpc/state.cpp
- src/rpc/bstate.cpp
src/rpc/websocket_api.cpp
src/log/log_message.cpp
src/log/logger.cpp
@@ -257,7 +240,6 @@ set( fc_sources
src/crypto/aes.cpp
src/crypto/crc.cpp
src/crypto/city.cpp
- src/crypto/base36.cpp
src/crypto/base58.cpp
src/crypto/base64.cpp
src/crypto/bigint.cpp
@@ -268,10 +250,9 @@ set( fc_sources
src/crypto/sha224.cpp
src/crypto/sha512.cpp
src/crypto/dh.cpp
- src/crypto/blowfish.cpp
src/crypto/elliptic_common.cpp
- ${ECC_REST}
- src/crypto/elliptic_${ECC_IMPL}.cpp
+ src/crypto/elliptic_impl_priv.cpp
+ src/crypto/elliptic_secp256k1.cpp
src/crypto/rand.cpp
src/network/tcp_socket.cpp
src/network/udp_socket.cpp
@@ -401,7 +382,7 @@ target_include_directories(fc
IF(NOT WIN32)
set(LINK_USR_LOCAL_LIB -L/usr/local/lib)
ENDIF()
-target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${editline_libraries} ${ECC_LIB} )
+target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${editline_libraries} secp256k1 )
if(MSVC)
set_source_files_properties( src/network/http/websocket.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
diff --git a/fc.natvis b/fc.natvis
index 7188bfa..81d74d6 100644
--- a/fc.natvis
+++ b/fc.natvis
@@ -31,12 +31,6 @@
-
- {my}
-
- my
-
-
invalid
@@ -54,4 +48,4 @@
-
\ No newline at end of file
+
diff --git a/include/fc/actor.hpp b/include/fc/actor.hpp
deleted file mode 100644
index 920d742..0000000
--- a/include/fc/actor.hpp
+++ /dev/null
@@ -1,65 +0,0 @@
-#pragma once
-#include
-#include
-
-namespace fc {
-
- namespace detail {
- struct actor_member {
- #if 1 // BOOST_NO_VARIADIC_TEMPLATES
- #define RPC_MEMBER_FUNCTOR(z,n,IS_CONST) \
- template \
- static std::function( BOOST_PP_ENUM_PARAMS(n,A) ) > \
- functor( P p, R (C::*mem_func)(BOOST_PP_ENUM_PARAMS(n,A)) IS_CONST, fc::thread* c = 0) { \
- return [=](BOOST_PP_ENUM_BINARY_PARAMS(n,A,a))->fc::future{ \
- return c->async( [=](){ return (p->*mem_func)(BOOST_PP_ENUM_PARAMS(n,a)); } ); }; \
- }
- BOOST_PP_REPEAT( 8, RPC_MEMBER_FUNCTOR, const )
- BOOST_PP_REPEAT( 8, RPC_MEMBER_FUNCTOR, BOOST_PP_EMPTY() )
- #undef RPC_MEMBER_FUNCTOR
-
- #else // g++ has a bug that prevents lambdas and varidic templates from working together (G++ Bug 41933)
-
- template
- static std::function(Args...)> functor( P&& p, R (C::*mem_func)(Args...), fc::thread* c ) {
- return [=](Args... args)->fc::future{ c->async( [=]()->R { return p->*mem_func( fc::forward(args)... ); } ) };
- }
- template
- static std::function(Args...)> functor( P&& p, R (C::*mem_func)(Args...)const, fc::thread* c ){
- return [=](Args... args)->fc::future{ c->async( [=]()->R { return p->*mem_func( fc::forward(args)... ); } ) };
- }
- #endif
- };
-
- template
- struct actor_vtable_visitor {
- template
- actor_vtable_visitor( fc::thread* t, U&& u ):_thread(t),_this( fc::forward(u) ){}
-
- template
- void operator()( const char* name, Function& memb, MemberPtr m )const {
- memb = actor_member::functor( _this, m, _thread );
- }
- fc::thread* _thread;
- ThisPtr _this;
- };
- }
-
- /**
- * Posts all method calls to another thread and
- * returns a future.
- */
- template
- class actor : public api {
- public:
- actor(){}
-
- template
- actor( InterfaceType* p, fc::thread* t = &fc::thread::current() )
- {
- this->_vtable.reset(new detail::vtable() );
- this->_vtable->template visit( detail::actor_vtable_visitor(t, p) );
- }
- };
-
-} // namespace fc
diff --git a/include/fc/aligned.hpp b/include/fc/aligned.hpp
deleted file mode 100644
index b107ed1..0000000
--- a/include/fc/aligned.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-namespace fc {
-
- template
- struct aligned {
- union {
- T _align;
- char _data[S];
- } _store;
- operator char*() { return _store._data; }
- operator const char*()const { return _store._data; }
- };
-
-}
diff --git a/include/fc/any.hpp b/include/fc/any.hpp
deleted file mode 100644
index 022d29e..0000000
--- a/include/fc/any.hpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma once
-#include
-
-namespace fc {
- // TODO: define this without using boost
- typedef boost::any any;
-}
diff --git a/include/fc/api.hpp b/include/fc/api.hpp
index 06414b1..3f68750 100644
--- a/include/fc/api.hpp
+++ b/include/fc/api.hpp
@@ -1,7 +1,7 @@
#pragma once
#include
-#include
#include
+#include
#include
// ms visual c++ (as of 2013) doesn't accept the standard syntax for calling a
@@ -75,7 +75,7 @@ namespace fc {
api( const T& p )
:_vtable( std::make_shared() )
{
- _data = std::make_shared(p);
+ _data = std::make_shared(p);
T& ptr = boost::any_cast(*_data);
auto& pointed_at = *ptr;
typedef typename std::remove_reference::type source_vtable_type;
@@ -95,7 +95,7 @@ namespace fc {
protected:
std::shared_ptr _vtable;
- std::shared_ptr _data;
+ std::shared_ptr _data;
};
} // namespace fc
diff --git a/include/fc/array.hpp b/include/fc/array.hpp
index 541cd69..687b175 100644
--- a/include/fc/array.hpp
+++ b/include/fc/array.hpp
@@ -112,7 +112,7 @@ namespace fc {
std::vector ve = v.as< std::vector >( 1 );
if( ve.size() )
{
- memcpy(&bi, ve.data(), fc::min(ve.size(),sizeof(bi)) );
+ memcpy(&bi, ve.data(), std::min(ve.size(),sizeof(bi)) );
}
else
memset( &bi, char(0), sizeof(bi) );
diff --git a/include/fc/asio.hpp b/include/fc/asio.hpp
index 3d11a38..06ba2f8 100644
--- a/include/fc/asio.hpp
+++ b/include/fc/asio.hpp
@@ -282,7 +282,7 @@ namespace asio {
{
public:
istream( std::shared_ptr str )
- :_stream( fc::move(str) ){}
+ :_stream( std::move(str) ){}
virtual size_t readsome( char* buf, size_t len )
{
@@ -302,7 +302,7 @@ namespace asio {
{
public:
ostream( std::shared_ptr str )
- :_stream( fc::move(str) ){}
+ :_stream( std::move(str) ){}
virtual size_t writesome( const char* buf, size_t len )
{
diff --git a/include/fc/compress/zlib.hpp b/include/fc/compress/zlib.hpp
index 10a3a0e..cd08ccf 100644
--- a/include/fc/compress/zlib.hpp
+++ b/include/fc/compress/zlib.hpp
@@ -1,10 +1,10 @@
#pragma once
-#include
+#include
namespace fc
{
- string zlib_compress(const string& in);
+std::string zlib_compress(const std::string& in);
} // namespace fc
diff --git a/include/fc/container/deque_fwd.hpp b/include/fc/container/deque_fwd.hpp
deleted file mode 100644
index 71df18d..0000000
--- a/include/fc/container/deque_fwd.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-
-#include
-#include
-
-namespace fc {
-
- namespace raw {
- template
- void pack( Stream& s, const std::deque& value, uint32_t _max_depth=FC_PACK_MAX_DEPTH );
- template
- void unpack( Stream& s, std::deque& value, uint32_t _max_depth=FC_PACK_MAX_DEPTH );
- }
-} // namespace fc
diff --git a/include/fc/crypto/base36.hpp b/include/fc/crypto/base36.hpp
deleted file mode 100644
index aeb9c35..0000000
--- a/include/fc/crypto/base36.hpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-#include
-#include
-
-namespace fc
-{
- std::vector from_base36( const fc::string& b36 );
- fc::string to_base36( const std::vector& vec );
- fc::string to_base36( const char* data, size_t len );
-}
diff --git a/include/fc/crypto/base58.hpp b/include/fc/crypto/base58.hpp
index 2f4fb38..17d52ea 100644
--- a/include/fc/crypto/base58.hpp
+++ b/include/fc/crypto/base58.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include
+#include
#include
namespace fc {
diff --git a/include/fc/crypto/bigint.hpp b/include/fc/crypto/bigint.hpp
index 58703a1..1fdee13 100644
--- a/include/fc/crypto/bigint.hpp
+++ b/include/fc/crypto/bigint.hpp
@@ -1,7 +1,7 @@
#pragma once
#include
-#include
-#include
+#include
+#include
struct bignum_st;
typedef bignum_st BIGNUM;
@@ -55,7 +55,7 @@ namespace fc {
bigint operator--(int);
bigint& operator--();
- operator fc::string()const;
+ operator std::string()const;
// returns bignum as bigendian bytes
operator std::vector()const;
diff --git a/include/fc/crypto/blowfish.hpp b/include/fc/crypto/blowfish.hpp
deleted file mode 100644
index fcda4e5..0000000
--- a/include/fc/crypto/blowfish.hpp
+++ /dev/null
@@ -1,178 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-///
-// Blowfish.h Header File
-//
-// BLOWFISH ENCRYPTION ALGORITHM
-//
-// encryption and decryption of Byte Strings using the Blowfish encryption Algorithm.
-// Blowfish is a block cipher that encrypts data in 8-byte blocks. The algorithm consists
-// of two parts: a key-expansion part and a data-ancryption part. Key expansion converts a
-// variable key of at least 1 and at most 56 bytes into several subkey arrays totaling
-// 4168 bytes. Blowfish has 16 rounds. Each round consists of a key-dependent permutation,
-// and a key and data-dependent substitution. All operations are XORs and additions on 32-bit words.
-// The only additional operations are four indexed array data lookups per round.
-// Blowfish uses a large number of subkeys. These keys must be precomputed before any data
-// encryption or decryption. The P-array consists of 18 32-bit subkeys: P0, P1,...,P17.
-// There are also four 32-bit S-boxes with 256 entries each: S0,0, S0,1,...,S0,255;
-// S1,0, S1,1,...,S1,255; S2,0, S2,1,...,S2,255; S3,0, S3,1,...,S3,255;
-//
-// The Electronic Code Book (ECB), Cipher Block Chaining (CBC) and Cipher Feedback modes
-// are used:
-//
-// In ECB mode if the same block is encrypted twice with the same key, the resulting
-// ciphertext blocks are the same.
-//
-// In CBC Mode a ciphertext block is obtained by first xoring the
-// plaintext block with the previous ciphertext block, and encrypting the resulting value.
-//
-// In CFB mode a ciphertext block is obtained by encrypting the previous ciphertext block
-// and xoring the resulting value with the plaintext
-//
-// The previous ciphertext block is usually stored in an Initialization Vector (IV).
-// An Initialization Vector of zero is commonly used for the first block, though other
-// arrangements are also in use.
-
-/*
-http://www.counterpane.com/vectors.txt
-Test vectors by Eric Young. These tests all assume Blowfish with 16
-rounds.
-
-All data is shown as a hex string with 012345 loading as
-data[0]=0x01;
-data[1]=0x23;
-data[2]=0x45;
-ecb test data (taken from the DES validation tests)
-
-key bytes clear bytes cipher bytes
-0000000000000000 0000000000000000 4EF997456198DD78
-FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF 51866FD5B85ECB8A
-3000000000000000 1000000000000001 7D856F9A613063F2 ???
-1111111111111111 1111111111111111 2466DD878B963C9D
-0123456789ABCDEF 1111111111111111 61F9C3802281B096
-1111111111111111 0123456789ABCDEF 7D0CC630AFDA1EC7
-0000000000000000 0000000000000000 4EF997456198DD78
-FEDCBA9876543210 0123456789ABCDEF 0ACEAB0FC6A0A28D
-7CA110454A1A6E57 01A1D6D039776742 59C68245EB05282B
-0131D9619DC1376E 5CD54CA83DEF57DA B1B8CC0B250F09A0
-07A1133E4A0B2686 0248D43806F67172 1730E5778BEA1DA4
-3849674C2602319E 51454B582DDF440A A25E7856CF2651EB
-04B915BA43FEB5B6 42FD443059577FA2 353882B109CE8F1A
-0113B970FD34F2CE 059B5E0851CF143A 48F4D0884C379918
-0170F175468FB5E6 0756D8E0774761D2 432193B78951FC98
-43297FAD38E373FE 762514B829BF486A 13F04154D69D1AE5
-07A7137045DA2A16 3BDD119049372802 2EEDDA93FFD39C79
-04689104C2FD3B2F 26955F6835AF609A D887E0393C2DA6E3
-37D06BB516CB7546 164D5E404F275232 5F99D04F5B163969
-1F08260D1AC2465E 6B056E18759F5CCA 4A057A3B24D3977B
-584023641ABA6176 004BD6EF09176062 452031C1E4FADA8E
-025816164629B007 480D39006EE762F2 7555AE39F59B87BD
-49793EBC79B3258F 437540C8698F3CFA 53C55F9CB49FC019
-4FB05E1515AB73A7 072D43A077075292 7A8E7BFA937E89A3
-49E95D6D4CA229BF 02FE55778117F12A CF9C5D7A4986ADB5
-018310DC409B26D6 1D9D5C5018F728C2 D1ABB290658BC778
-1C587F1C13924FEF 305532286D6F295A 55CB3774D13EF201
-0101010101010101 0123456789ABCDEF FA34EC4847B268B2
-1F1F1F1F0E0E0E0E 0123456789ABCDEF A790795108EA3CAE
-E0FEE0FEF1FEF1FE 0123456789ABCDEF C39E072D9FAC631D
-0000000000000000 FFFFFFFFFFFFFFFF 014933E0CDAFF6E4
-FFFFFFFFFFFFFFFF 0000000000000000 F21E9A77B71C49BC
-0123456789ABCDEF 0000000000000000 245946885754369A
-FEDCBA9876543210 FFFFFFFFFFFFFFFF 6B5C5A9C5D9E0A5A
-
-set_key test data
-data[8]= FEDCBA9876543210
-c=F9AD597C49DB005E k[ 1]=F0
-c=E91D21C1D961A6D6 k[ 2]=F0E1
-c=E9C2B70A1BC65CF3 k[ 3]=F0E1D2
-c=BE1E639408640F05 k[ 4]=F0E1D2C3
-c=B39E44481BDB1E6E k[ 5]=F0E1D2C3B4
-c=9457AA83B1928C0D k[ 6]=F0E1D2C3B4A5
-c=8BB77032F960629D k[ 7]=F0E1D2C3B4A596
-c=E87A244E2CC85E82 k[ 8]=F0E1D2C3B4A59687
-c=15750E7A4F4EC577 k[ 9]=F0E1D2C3B4A5968778
-c=122BA70B3AB64AE0 k[10]=F0E1D2C3B4A596877869
-c=3A833C9AFFC537F6 k[11]=F0E1D2C3B4A5968778695A
-c=9409DA87A90F6BF2 k[12]=F0E1D2C3B4A5968778695A4B
-c=884F80625060B8B4 k[13]=F0E1D2C3B4A5968778695A4B3C
-c=1F85031C19E11968 k[14]=F0E1D2C3B4A5968778695A4B3C2D
-c=79D9373A714CA34F k[15]=F0E1D2C3B4A5968778695A4B3C2D1E ???
-c=93142887EE3BE15C k[16]=F0E1D2C3B4A5968778695A4B3C2D1E0F
-c=03429E838CE2D14B k[17]=F0E1D2C3B4A5968778695A4B3C2D1E0F00
-c=A4299E27469FF67B k[18]=F0E1D2C3B4A5968778695A4B3C2D1E0F0011
-c=AFD5AED1C1BC96A8 k[19]=F0E1D2C3B4A5968778695A4B3C2D1E0F001122
-c=10851C0E3858DA9F k[20]=F0E1D2C3B4A5968778695A4B3C2D1E0F00112233
-c=E6F51ED79B9DB21F k[21]=F0E1D2C3B4A5968778695A4B3C2D1E0F0011223344
-c=64A6E14AFD36B46F k[22]=F0E1D2C3B4A5968778695A4B3C2D1E0F001122334455
-c=80C7D7D45A5479AD k[23]=F0E1D2C3B4A5968778695A4B3C2D1E0F00112233445566
-c=05044B62FA52D080 k[24]=F0E1D2C3B4A5968778695A4B3C2D1E0F0011223344556677
-
-chaining mode test data
-key[16] = 0123456789ABCDEFF0E1D2C3B4A59687
-iv[8] = FEDCBA9876543210
-data[29] = "7654321 Now is the time for " (includes trailing '\0')
-data[29] = 37363534333231204E6F77206973207468652074696D6520666F722000
-cbc cipher text
-cipher[32]= 6B77B4D63006DEE605B156E27403979358DEB9E7154616D959F1652BD5FF92CC
-cfb64 cipher text cipher[29]=
-E73214A2822139CAF26ECF6D2EB9E76E3DA3DE04D1517200519D57A6C3
-ofb64 cipher text cipher[29]=
-E73214A2822139CA62B343CC5B65587310DD908D0C241B2263C2CF80DA
-
-*/
-
-#pragma once
-#include
-
-namespace fc {
-
-//Block Structure
-struct sblock
-{
- //Constructors
- sblock(unsigned int l=0, unsigned int r=0) : m_uil(l), m_uir(r) {}
- //Copy Constructor
- sblock(const sblock& roBlock) : m_uil(roBlock.m_uil), m_uir(roBlock.m_uir) {}
- sblock& operator^=(sblock& b) { m_uil ^= b.m_uil; m_uir ^= b.m_uir; return *this; }
- unsigned int m_uil, m_uir;
-};
-
-class blowfish
-{
-public:
- enum { ECB=0, CBC=1, CFB=2 };
-
- //Constructor - Initialize the P and S boxes for a given Key
- blowfish();
- void start(unsigned char* ucKey, uint64_t n, const sblock& roChain = sblock(0UL,0UL));
-
- //Resetting the chaining block
- void reset_chain() { m_oChain = m_oChain0; }
-
- // encrypt/decrypt Buffer in Place
- void encrypt(unsigned char* buf, uint64_t n, int iMode=CFB);
- void decrypt(unsigned char* buf, uint64_t n, int iMode=CFB);
-
- // encrypt/decrypt from Input Buffer to Output Buffer
- void encrypt(const unsigned char* in, unsigned char* out, uint64_t n, int iMode=CFB);
- void decrypt(const unsigned char* in, unsigned char* out, uint64_t n, int iMode=CFB);
-
-//Private Functions
-private:
- unsigned int F(unsigned int ui);
- void encrypt(sblock&);
- void decrypt(sblock&);
-
-private:
- //The Initialization Vector, by default {0, 0}
- sblock m_oChain0;
- sblock m_oChain;
- unsigned int m_auiP[18];
- unsigned int m_auiS[4][256];
- static const unsigned int scm_auiInitP[18];
- static const unsigned int scm_auiInitS[4][256];
-};
-
-
-} // namespace fc
-
-
diff --git a/include/fc/crypto/elliptic.hpp b/include/fc/crypto/elliptic.hpp
index 3bc16b7..7ca2ec6 100644
--- a/include/fc/crypto/elliptic.hpp
+++ b/include/fc/crypto/elliptic.hpp
@@ -153,9 +153,9 @@ namespace fc {
extended_key_data serialize_extended() const;
static extended_public_key deserialize( const extended_key_data& data );
- fc::string str() const;
- fc::string to_base58() const { return str(); }
- static extended_public_key from_base58( const fc::string& base58 );
+ std::string str() const;
+ std::string to_base58() const { return str(); }
+ static extended_public_key from_base58( const std::string& base58 );
private:
sha256 c;
@@ -177,10 +177,10 @@ namespace fc {
extended_key_data serialize_extended() const;
static extended_private_key deserialize( const extended_key_data& data );
- fc::string str() const;
- fc::string to_base58() const { return str(); }
- static extended_private_key from_base58( const fc::string& base58 );
- static extended_private_key generate_master( const fc::string& seed );
+ std::string str() const;
+ std::string to_base58() const { return str(); }
+ static extended_private_key from_base58( const std::string& base58 );
+ static extended_private_key generate_master( const std::string& seed );
static extended_private_key generate_master( const char* seed, uint32_t seed_len );
private:
diff --git a/include/fc/crypto/hex.hpp b/include/fc/crypto/hex.hpp
index 201f167..fd60d84 100644
--- a/include/fc/crypto/hex.hpp
+++ b/include/fc/crypto/hex.hpp
@@ -1,15 +1,15 @@
#pragma once
-#include
-#include
+#include
+#include
#include
namespace fc {
uint8_t from_hex( char c );
- fc::string to_hex( const char* d, uint32_t s );
+ std::string to_hex( const char* d, uint32_t s );
std::string to_hex( const std::vector& data );
/**
* @return the number of bytes decoded
*/
- size_t from_hex( const fc::string& hex_str, char* out_data, size_t out_data_len );
+ size_t from_hex( const std::string& hex_str, char* out_data, size_t out_data_len );
}
diff --git a/include/fc/crypto/pke.hpp b/include/fc/crypto/pke.hpp
deleted file mode 100644
index db33b46..0000000
--- a/include/fc/crypto/pke.hpp
+++ /dev/null
@@ -1,117 +0,0 @@
-#pragma once
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace fc {
- namespace detail { class pke_impl; }
-
- class private_key;
- class public_key;
- void generate_key_pair( public_key&, private_key& );
-
- typedef std::vector bytes;
- typedef bytes signature;
-
- class public_key
- {
- public:
- public_key();
- explicit public_key( const bytes& d );
- public_key( const public_key& k );
- public_key( public_key&& k );
- ~public_key();
-
- operator bool()const;
-
- public_key& operator=(const public_key& p );
- public_key& operator=(public_key&& p );
-
- bool verify( const sha1& digest, const array& sig )const;
- bool verify( const sha1& digest, const signature& sig )const;
- bool verify( const sha256& digest, const signature& sig )const;
- bytes encrypt( const char* data, size_t len )const;
- bytes encrypt( const bytes& )const;
- bytes decrypt( const bytes& )const;
-
- bytes serialize()const;
- friend void generate_key_pair( public_key&, private_key& );
- private:
- std::shared_ptr my;
- };
-
- class private_key
- {
- public:
- private_key();
- explicit private_key( const bytes& d );
- private_key( const private_key& k );
- private_key( private_key&& k );
- ~private_key();
-
- operator bool()const;
-
- private_key& operator=(const private_key& p );
- private_key& operator=(private_key&& p );
-
- void sign( const sha1& digest, array& sig )const;
- signature sign( const sha1& digest )const;
- signature sign( const sha256& digest )const;
-
- bytes decrypt( const char* bytes, size_t len )const;
- bytes decrypt( const bytes& )const;
- bytes encrypt( const bytes& )const;
-
- bytes serialize()const;
- friend void generate_key_pair( public_key&, private_key& );
-
- private:
- std::shared_ptr my;
- };
- bool operator==( const private_key& a, const private_key& b );
-
- namespace raw
- {
- template
- void unpack( Stream& s, fc::public_key& pk, uint32_t _max_depth=FC_PACK_MAX_DEPTH )
- {
- FC_ASSERT( _max_depth > 0 );
- bytes ser;
- fc::raw::unpack( s, ser, _max_depth - 1 );
- pk = fc::public_key( ser );
- }
-
- template
- void pack( Stream& s, const fc::public_key& pk, uint32_t _max_depth=FC_PACK_MAX_DEPTH )
- {
- FC_ASSERT( _max_depth > 0 );
- fc::raw::pack( s, pk.serialize(), _max_depth - 1 );
- }
-
- template
- void unpack( Stream& s, fc::private_key& pk, uint32_t _max_depth=FC_PACK_MAX_DEPTH )
- {
- FC_ASSERT( _max_depth > 0 );
- bytes ser;
- fc::raw::unpack( s, ser, _max_depth - 1 );
- pk = fc::private_key( ser );
- }
-
- template
- void pack( Stream& s, const fc::private_key& pk, uint32_t _max_depth=FC_PACK_MAX_DEPTH )
- {
- FC_ASSERT( _max_depth > 0 );
- fc::raw::pack( s, pk.serialize(), _max_depth - 1 );
- }
- }
- class variant;
- void to_variant( const public_key& bi, variant& v, uint32_t max_depth = 1 );
- void from_variant( const variant& v, public_key& bi, uint32_t max_depth = 1 );
- void to_variant( const private_key& bi, variant& v, uint32_t max_depth = 1 );
- void from_variant( const variant& v, private_key& bi, uint32_t max_depth = 1 );
-
-} // fc
-
diff --git a/include/fc/crypto/sha1.hpp b/include/fc/crypto/sha1.hpp
index 01c6ca8..46b76e4 100644
--- a/include/fc/crypto/sha1.hpp
+++ b/include/fc/crypto/sha1.hpp
@@ -1,8 +1,8 @@
#pragma once
#include
-#include
#include
+#include
namespace fc{
@@ -10,16 +10,16 @@ class sha1
{
public:
sha1();
- explicit sha1( const string& hex_str );
+ explicit sha1( const std::string& hex_str );
- string str()const;
- operator string()const;
+ std::string str()const;
+ operator std::string()const;
char* data()const;
size_t data_size()const { return 20; }
static sha1 hash( const char* d, uint32_t dlen );
- static sha1 hash( const string& );
+ static sha1 hash( const std::string& );
template
static sha1 hash( const T& t )
diff --git a/include/fc/crypto/sha224.hpp b/include/fc/crypto/sha224.hpp
index 20d484f..97a36b8 100644
--- a/include/fc/crypto/sha224.hpp
+++ b/include/fc/crypto/sha224.hpp
@@ -2,7 +2,6 @@
#include
#include
#include
-#include
namespace fc
{
diff --git a/include/fc/crypto/sha256.hpp b/include/fc/crypto/sha256.hpp
index 33a2bfc..bdc6737 100644
--- a/include/fc/crypto/sha256.hpp
+++ b/include/fc/crypto/sha256.hpp
@@ -1,6 +1,5 @@
#pragma once
#include
-#include
#include
#include
diff --git a/include/fc/crypto/sha512.hpp b/include/fc/crypto/sha512.hpp
index a6c4a36..9751a56 100644
--- a/include/fc/crypto/sha512.hpp
+++ b/include/fc/crypto/sha512.hpp
@@ -1,6 +1,5 @@
#pragma once
#include
-#include
namespace fc
{
diff --git a/include/fc/exception/exception.hpp b/include/fc/exception/exception.hpp
index ec100f4..b9b6d8e 100644
--- a/include/fc/exception/exception.hpp
+++ b/include/fc/exception/exception.hpp
@@ -240,9 +240,9 @@ namespace fc
TYPE( const std::string& what_value, const fc::log_messages& m ) \
:BASE( m, CODE, BOOST_PP_STRINGIZE(TYPE), what_value ){} \
TYPE( fc::log_message&& m ) \
- :BASE( fc::move(m), CODE, BOOST_PP_STRINGIZE(TYPE), WHAT ){}\
+ :BASE( std::move(m), CODE, BOOST_PP_STRINGIZE(TYPE), WHAT ){}\
TYPE( fc::log_messages msgs ) \
- :BASE( fc::move( msgs ), CODE, BOOST_PP_STRINGIZE(TYPE), WHAT ) {} \
+ :BASE( std::move( msgs ), CODE, BOOST_PP_STRINGIZE(TYPE), WHAT ) {} \
TYPE( const TYPE& c ) \
:BASE(c){} \
TYPE( const BASE& c ) \
diff --git a/include/fc/filesystem.hpp b/include/fc/filesystem.hpp
index 38fb74a..bd1aa5d 100644
--- a/include/fc/filesystem.hpp
+++ b/include/fc/filesystem.hpp
@@ -2,7 +2,6 @@
#include
#include
-#include
#include
#include
#include
@@ -228,37 +227,5 @@ namespace fc {
temp_directory(const fc::path& tempFolder = fc::temp_directory_path());
};
-
-#if !defined(__APPLE__)
- // this code is known to work on linux and windows. It may work correctly on mac,
- // or it may need slight tweaks or extra includes. It's disabled now to avoid giving
- // a false sense of security.
-# define FC_HAS_SIMPLE_FILE_LOCK
-#endif
-#ifdef FC_HAS_SIMPLE_FILE_LOCK
- /** simple class which only allows one process to open any given file.
- * approximate usage:
- * int main() {
- * fc::simple_file_lock instance_lock("~/.my_app/.lock");
- * if (!instance_lock.try_lock()) {
- * elog("my_app is already running");
- * return 1;
- * }
- * // do stuff here, file will be unlocked when instance_lock goes out of scope
- * }
- */
- class simple_lock_file
- {
- public:
- simple_lock_file(const path& lock_file_path);
- ~simple_lock_file();
- bool try_lock();
- void unlock();
- private:
- class impl;
- std::unique_ptr my;
- };
-#endif // FC_HAS_SIMPLE_FILE_LOCK
-
}
diff --git a/include/fc/fixed_string.hpp b/include/fc/fixed_string.hpp
deleted file mode 100644
index a91b651..0000000
--- a/include/fc/fixed_string.hpp
+++ /dev/null
@@ -1,143 +0,0 @@
-#pragma once
-#include
-
-
-namespace fc {
-
-
- /**
- * This class is designed to offer in-place memory allocation of a string up to Length equal to
- * sizeof(Storage).
- *
- * The string will serialize the same way as std::string for variant and raw formats
- * The string will sort according to the comparison operators defined for Storage, this enables effecient
- * sorting.
- */
- template >
- class fixed_string {
- public:
- fixed_string(){}
- fixed_string( const fixed_string& c ):data(c.data){}
-
- fixed_string( const std::string& str ) {
- if( str.size() <= sizeof(data) )
- memcpy( (char*)&data, str.c_str(), str.size() );
- else {
- memcpy( (char*)&data, str.c_str(), sizeof(data) );
- }
- }
- fixed_string( const char* str ) {
- auto l = strlen(str);
- if( l <= sizeof(data) )
- memcpy( (char*)&data, str, l );
- else {
- memcpy( (char*)&data, str, sizeof(data) );
- }
- }
-
- operator std::string()const {
- const char* self = (const char*)&data;
- return std::string( self, self + size() );
- }
-
- uint32_t size()const {
- if( *(((const char*)&data)+sizeof(data) - 1) )
- return sizeof(data);
- return strnlen( (const char*)&data, sizeof(data) );
- }
- uint32_t length()const { return size(); }
-
- fixed_string& operator=( const fixed_string& str ) {
- data = str.data;
- return *this;
- }
- fixed_string& operator=( const char* str ) {
- return *this = fixed_string(str);
- }
-
- fixed_string& operator=( const std::string& str ) {
- if( str.size() <= sizeof(data) ) {
- data = Storage();
- memcpy( (char*)&data, str.c_str(), str.size() );
- }
- else {
- memcpy( (char*)&data, str.c_str(), sizeof(data) );
- }
- return *this;
- }
-
- friend std::string operator + ( const fixed_string& a, const std::string& b ) {
- return std::string(a) + b;
- }
- friend std::string operator + ( const std::string& a, const fixed_string& b ) {
- return a + std::string(b);
- }
-
- friend bool operator < ( const fixed_string& a, const fixed_string& b ) {
- return a.data < b.data;
- }
- friend bool operator <= ( const fixed_string& a, const fixed_string& b ) {
- return a.data <= b.data;
- }
- friend bool operator > ( const fixed_string& a, const fixed_string& b ) {
- return a.data > b.data;
- }
- friend bool operator >= ( const fixed_string& a, const fixed_string& b ) {
- return a.data >= b.data;
- }
- friend bool operator == ( const fixed_string& a, const fixed_string& b ) {
- return a.data == b.data;
- }
- friend bool operator != ( const fixed_string& a, const fixed_string& b ) {
- return a.data != b.data;
- }
- //private:
- Storage data;
- };
-
- namespace raw
- {
- template
- inline void pack( Stream& s, const fc::fixed_string& u, uint32_t _max_depth=FC_PACK_MAX_DEPTH ) {
- FC_ASSERT( _max_depth > 0 );
- unsigned_int size = u.size();
- pack( s, size, _max_depth - 1 );
- s.write( (const char*)&u.data, size );
- }
-
- template
- inline void unpack( Stream& s, fc::fixed_string& u, uint32_t _max_depth=FC_PACK_MAX_DEPTH ) {
- FC_ASSERT( _max_depth > 0 );
- unsigned_int size;
- fc::raw::unpack( s, size, _max_depth - 1 );
- if( size.value > 0 ) {
- if( size.value > sizeof(Storage) ) {
- s.read( (char*)&u.data, sizeof(Storage) );
- char buf[1024];
- size_t left = size.value - sizeof(Storage);
- while( left >= 1024 )
- {
- s.read( buf, 1024 );
- left -= 1024;
- }
- s.read( buf, left );
- } else {
- s.read( (char*)&u.data, size.value );
- }
- }
- }
- }
-}
-
-#include
-namespace fc {
- template
- void to_variant( const fixed_string& s, variant& v, uint32_t max_depth = 1 ) {
- v = std::string(s);
- }
-
- template
- void from_variant( const variant& v, fixed_string& s, uint32_t max_depth = 1 ) {
- s = v.as_string();
- }
-}
diff --git a/include/fc/fwd.hpp b/include/fc/fwd.hpp
index ccf0828..b1a4006 100644
--- a/include/fc/fwd.hpp
+++ b/include/fc/fwd.hpp
@@ -1,5 +1,4 @@
#pragma once
-#include
namespace fc {
@@ -37,7 +36,7 @@ class fwd {
~fwd();
private:
- aligned _store;
+ alignas(Align) char _store[S];
};
diff --git a/include/fc/fwd_impl.hpp b/include/fc/fwd_impl.hpp
index 639085a..53a4440 100644
--- a/include/fc/fwd_impl.hpp
+++ b/include/fc/fwd_impl.hpp
@@ -3,31 +3,33 @@
#include
#include
#include
+#include
+#include
namespace fc {
namespace detail {
template
struct add {
- typedef decltype( *((A*)0) + *((typename fc::remove_reference::type*)0) ) type;
+ typedef decltype( *((A*)0) + *((typename std::remove_reference::type*)0) ) type;
};
template
struct add_eq {
- typedef decltype( *((A*)0) += *((typename fc::remove_reference::type*)0) ) type;
+ typedef decltype( *((A*)0) += *((typename std::remove_reference::type*)0) ) type;
};
template
struct sub {
- typedef decltype( *((A*)0) - *((typename fc::remove_reference::type*)0) ) type;
+ typedef decltype( *((A*)0) - *((typename std::remove_reference::type*)0) ) type;
};
template
struct sub_eq {
- typedef decltype( *((A*)0) -= *((typename fc::remove_reference::type*)0) ) type;
+ typedef decltype( *((A*)0) -= *((typename std::remove_reference::type*)0) ) type;
};
template
struct insert_op {
- typedef decltype( *((A*)0) << *((typename fc::remove_reference::type*)0) ) type;
+ typedef decltype( *((A*)0) << *((typename std::remove_reference::type*)0) ) type;
};
template
struct extract_op {
@@ -91,7 +93,7 @@ namespace fc {
template
fwd::fwd( fwd&& f ){
check_size();
- new (this) T( fc::move(*f) );
+ new (this) T( std::move(*f) );
}
@@ -124,7 +126,7 @@ namespace fc {
template
T& fwd::operator = ( fwd&& u ) {
- return **this = fc::move(*u);
+ return **this = std::move(*u);
}
template
T& fwd::operator = ( const fwd& u ) {
diff --git a/include/fc/interprocess/container.hpp b/include/fc/interprocess/container.hpp
deleted file mode 100644
index a1a4658..0000000
--- a/include/fc/interprocess/container.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-#pragma once
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace fc {
-
- namespace bip = boost::interprocess;
-
- template
- void to_variant( const bip::deque< T... >& t, fc::variant& v, uint32_t max_depth ) {
- FC_ASSERT( max_depth > 0, "Recursion depth exceeded!" );
- --max_depth;
- std::vector vars(t.size());
- for( size_t i = 0; i < t.size(); ++i ) {
- to_variant( t[i], vars[i], max_depth );
- }
- v = std::move(vars);
- }
-
- template
- void from_variant( const fc::variant& v, bip::deque< T, A... >& d, uint32_t max_depth ) {
- FC_ASSERT( max_depth > 0, "Recursion depth exceeded!" );
- --max_depth;
- const variants& vars = v.get_array();
- d.clear();
- d.resize( vars.size() );
- for( uint32_t i = 0; i < vars.size(); ++i ) {
- from_variant( vars[i], d[i], max_depth );
- }
- }
-
- template
- void to_variant( const bip::map< K, V, T... >& var, fc::variant& vo, uint32_t max_depth ) {
- FC_ASSERT( max_depth > 0, "Recursion depth exceeded!" );
- --max_depth;
- std::vector< variant > vars(var.size());
- size_t i = 0;
- for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
- vars[i] = fc::variant( *itr, max_depth );
- vo = vars;
- }
-
- template
- void to_variant( const bip::vector< T... >& t, fc::variant& v, uint32_t max_depth ) {
- FC_ASSERT( max_depth > 0, "Recursion depth exceeded!" );
- --max_depth;
- std::vector vars(t.size());
- for( size_t i = 0; i < t.size(); ++i ) {
- to_variant( t[i], vars[i], max_depth );
- }
- v = std::move(vars);
- }
-
- template
- void from_variant( const fc::variant& v, bip::vector< T, A... >& d, uint32_t max_depth ) {
- FC_ASSERT( max_depth > 0, "Recursion depth exceeded!" );
- --max_depth;
- const variants& vars = v.get_array();
- d.clear();
- d.resize( vars.size() );
- for( uint32_t i = 0; i < vars.size(); ++i ) {
- from_variant( vars[i], d[i], max_depth );
- }
- }
-
- template
- void to_variant( const bip::set< T... >& t, fc::variant& v, uint32_t max_depth ) {
- FC_ASSERT( max_depth > 0, "Recursion depth exceeded!" );
- --max_depth;
- std::vector vars;
- vars.reserve(t.size());
- for( const auto& item : t ) {
- vars.emplace_back( variant( item, max_depth ) );
- }
- v = std::move(vars);
- }
-
- template
- void to_variant( const bip::vector& t, fc::variant& v, uint32_t max_depth = 1 )
- {
- if( t.size() )
- v = variant(fc::to_hex(t.data(), t.size()));
- else
- v = "";
- }
-
- template
- void from_variant( const fc::variant& v, bip::vector& d, uint32_t max_depth = 1 )
- {
- auto str = v.as_string();
- d.resize( str.size() / 2 );
- if( d.size() )
- {
- size_t r = fc::from_hex( str, d.data(), d.size() );
- FC_ASSERT( r == d.size() );
- }
- }
-}
diff --git a/include/fc/interprocess/file_mapping.hpp b/include/fc/interprocess/file_mapping.hpp
index e6b6817..369e6fa 100644
--- a/include/fc/interprocess/file_mapping.hpp
+++ b/include/fc/interprocess/file_mapping.hpp
@@ -1,6 +1,7 @@
#pragma once
#include
-#include
+#include
+#include
namespace boost {
namespace interprocess {
@@ -24,7 +25,7 @@ namespace fc {
#ifdef _WIN64
fc::fwd my;
#else
- fc::fwd my;
+ fc::fwd my;
#endif
};
diff --git a/include/fc/interprocess/file_mutex.hpp b/include/fc/interprocess/file_mutex.hpp
deleted file mode 100644
index 6041824..0000000
--- a/include/fc/interprocess/file_mutex.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#pragma once
-#include
-#include
-
-#include
-
-namespace fc {
- class microseconds;
- class time_point;
- class path;
- struct context;
-
- namespace detail { class file_mutex_impl; }
-
- /**
- * The purpose of this class is to support synchronization of
- * processes, threads, and coop-threads.
- *
- * Before grabbing the lock for a thread or coop, a file_mutex will first
- * grab a process-level lock. After grabbing the process level lock, it will
- * synchronize in the same way as a local process lock.
- */
- class file_mutex {
- public:
- file_mutex( const fc::path& filename );
- ~file_mutex();
-
- bool try_lock();
- bool try_lock_for( const microseconds& rel_time );
- bool try_lock_until( const time_point& abs_time );
- void lock();
- void unlock();
-
- void lock_shared();
- void unlock_shared();
- bool try_lock_shared();
-
- int readers()const;
-
- private:
- std::unique_ptr my;
- };
-
-} // namespace fc
diff --git a/include/fc/interprocess/iprocess.hpp b/include/fc/interprocess/iprocess.hpp
deleted file mode 100644
index c7f8c4e..0000000
--- a/include/fc/interprocess/iprocess.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-#pragma once
-#include
-#include
-#include
-#include
-#include
-
-namespace fc
-{
- /**
- * @brief abstract interface for interacting with external processes
- *
- * At the very least we have ssh::process and direct child processes, and
- * there may be other processes that need to implement this protocol.
- */
- class iprocess
- {
- public:
- enum exec_opts {
- open_none = 0,
- open_stdin = 0x01,
- open_stdout = 0x02,
- open_stderr = 0x04,
- open_all = open_stdin|open_stdout|open_stderr,
- suppress_console = 0x08
- };
-
- virtual ~iprocess(){}
-
- /**
- *
- * @return *this
- */
- virtual iprocess& exec( const path& exe, std::vector args,
- const path& work_dir = path(), int opts = open_all ) = 0;
-
- /**
- * @return blocks until the process exits
- */
- virtual int result(const microseconds& timeout = microseconds::maximum()) = 0;
-
-
- /**
- * Forcefully kills the process.
- */
- virtual void kill() = 0;
-
- /**
- * @brief returns a stream that writes to the process' stdin
- */
- virtual buffered_ostream_ptr in_stream() = 0;
-
- /**
- * @brief returns a stream that reads from the process' stdout
- */
- virtual buffered_istream_ptr out_stream() = 0;
- /**
- * @brief returns a stream that reads from the process' stderr
- */
- virtual buffered_istream_ptr err_stream() = 0;
-
- };
-
- typedef std::shared_ptr iprocess_ptr;
-
-
-} // namespace fc
diff --git a/include/fc/interprocess/mmap_struct.hpp b/include/fc/interprocess/mmap_struct.hpp
deleted file mode 100644
index 0913deb..0000000
--- a/include/fc/interprocess/mmap_struct.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#pragma once
-#include
-#include
-
-namespace fc
-{
- class path;
- namespace detail
- {
- /**
- * Base class used to hide common implementation details.
- */
- class mmap_struct_base
- {
- public:
- size_t size()const;
- void flush();
-
- protected:
- void open( const fc::path& file, size_t s, bool create );
- std::unique_ptr _file_mapping;
- std::unique_ptr _mapped_region;
- };
- };
-
- /**
- * @class mmap_struct
- * @brief A struct that has been mapped from a file.
- *
- * @note T must be POD
- */
- template
- class mmap_struct : public detail::mmap_struct_base
- {
- public:
- mmap_struct():_mapped_struct(nullptr){}
- /**
- * Create the file if it does not exist or is of the wrong size if create is true, then maps
- * the file to memory.
- *
- * @throw an exception if the file does not exist or is the wrong size and create is false
- */
- void open( const fc::path& file, bool create = false )
- {
- detail::mmap_struct_base::open( file, sizeof(T), create );
- _mapped_struct = (T*)_mapped_region->get_address();
- }
-
- T* operator->() { return _mapped_struct; }
- const T* operator->()const { return _mapped_struct; }
-
- T& operator*() { return *_mapped_struct; }
- const T& operator*()const { return *_mapped_struct; }
-
- private:
- T* _mapped_struct;
- };
-
-}
diff --git a/include/fc/interprocess/process.hpp b/include/fc/interprocess/process.hpp
deleted file mode 100644
index 777c154..0000000
--- a/include/fc/interprocess/process.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#pragma once
-#include
-
-namespace fc {
-
- fc::path find_executable_in_path( const fc::string name );
-
- /**
- * @brief start and manage an local process
- * @note this class implements reference semantics.
- */
- class process : public iprocess
- {
- public:
- process();
- ~process();
-
- virtual iprocess& exec( const fc::path& exe,
- std::vector args,
- const fc::path& work_dir = fc::path(),
- int opts = open_all );
-
-
- virtual int result(const microseconds& timeout = microseconds::maximum());
- virtual void kill();
- virtual fc::buffered_ostream_ptr in_stream();
- virtual fc::buffered_istream_ptr out_stream();
- virtual fc::buffered_istream_ptr err_stream();
-
- class impl;
- private:
- std::unique_ptr my;
- };
-
- typedef std::shared_ptr process_ptr;
-
-} // namespace fc
diff --git a/include/fc/io/console.hpp b/include/fc/io/console.hpp
deleted file mode 100644
index 11a9d47..0000000
--- a/include/fc/io/console.hpp
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma once
-namespace fc
-{
- /** enables / disables echoing of console input, useful for
- * entering passwords on the console.
- */
- void set_console_echo( bool enable_echo );
-} // namespace fc
diff --git a/include/fc/io/iobuffer.hpp b/include/fc/io/iobuffer.hpp
deleted file mode 100644
index 02f919b..0000000
--- a/include/fc/io/iobuffer.hpp
+++ /dev/null
@@ -1,81 +0,0 @@
-#pragma once
-#include
-#include
-
-namespace fc
-{
- /**
- * Records the size, but discards the data.
- */
- class size_stream : public virtual fc::ostream
- {
- public:
- size_stream( size_t s = 0):_size(s){}
-
- size_t size()const { return _size; }
- size_t seek( size_t pos ) { return _size = pos; }
-
- virtual size_t writesome( const char* /*ignored buf*/, size_t len )
- {
- _size += len;
- return len;
- }
-
- virtual void close(){}
- virtual void flush(){}
-
- private:
- size_t _size;
- };
-
-
- class iobuffer : public virtual fc::iostream
- {
- public:
- iobuffer( size_t s )
- :_data(s){}
-
- size_t size()const { return _data.size(); }
- size_t pos()const { return _pos; }
- size_t seek( size_t pos )
- {
- return _pos = std::min(_data.size(),pos);
- }
-
- virtual size_t readsome( char* buf, size_t len )
- {
- auto avail = std::min( _data.size()-_pos, len );
- if( avail == 0 ) throw fc::eof_exception();
- memcpy( buf, _data.data()+_pos, avail );
- _pos += avail;
- return avail;
- }
- /**
- * This method may block until at least 1 character is
- * available.
- */
- char peek()const
- {
- if( _pos == _data.size() ) throw fc::eof_exception();
- return _data[_pos];
- }
-
- virtual size_t writesome( const char* buf, size_t len )
- {
- auto avail = std::max( _data.size(), _pos + len );
- _data.resize(avail);
- memcpy( _data.data()+_pos, buf, len );
- _pos += avail;
- return avail;
- }
- char* data() { return _data.data(); }
-
- virtual void close(){}
- virtual void flush(){}
-
- private:
- std::vector _data;
- size_t _pos;
- };
-
-}
diff --git a/include/fc/io/iostream.hpp b/include/fc/io/iostream.hpp
index 1ec632f..3e68440 100644
--- a/include/fc/io/iostream.hpp
+++ b/include/fc/io/iostream.hpp
@@ -1,7 +1,6 @@
#pragma once
-#include
-#include
#include
+#include
namespace fc {
@@ -61,7 +60,7 @@ namespace fc {
class iostream : public virtual ostream, public virtual istream {};
- fc::istream& getline( fc::istream&, fc::string&, char delim = '\n' );
+ fc::istream& getline( fc::istream&, std::string&, char delim = '\n' );
template
ostream& operator<<( ostream& o, char (&array)[N] )
@@ -72,7 +71,7 @@ namespace fc {
ostream& operator<<( ostream& o, char );
ostream& operator<<( ostream& o, const char* v );
ostream& operator<<( ostream& o, const std::string& v );
- ostream& operator<<( ostream& o, const fc::string& v );
+ ostream& operator<<( ostream& o, const std::string& v );
ostream& operator<<( ostream& o, const double& v );
ostream& operator<<( ostream& o, const float& v );
ostream& operator<<( ostream& o, const int64_t& v );
@@ -88,7 +87,7 @@ namespace fc {
#endif
istream& operator>>( istream& o, std::string& v );
- istream& operator>>( istream& o, fc::string& v );
+ istream& operator>>( istream& o, std::string& v );
istream& operator>>( istream& o, char& v );
istream& operator>>( istream& o, double& v );
istream& operator>>( istream& o, float& v );
diff --git a/include/fc/io/json.hpp b/include/fc/io/json.hpp
index f07124b..0f97c40 100644
--- a/include/fc/io/json.hpp
+++ b/include/fc/io/json.hpp
@@ -33,7 +33,7 @@ namespace fc
legacy_generator = 1
};
- static ostream& to_stream( ostream& out, const fc::string& );
+ static ostream& to_stream( ostream& out, const std::string& );
static ostream& to_stream( ostream& out, const variant& v, output_formatting format = stringify_large_ints_and_doubles, uint32_t max_depth = DEFAULT_MAX_RECURSION_DEPTH );
static ostream& to_stream( ostream& out, const variants& v, output_formatting format = stringify_large_ints_and_doubles, uint32_t max_depth = DEFAULT_MAX_RECURSION_DEPTH );
static ostream& to_stream( ostream& out, const variant_object& v, output_formatting format = stringify_large_ints_and_doubles, uint32_t max_depth = DEFAULT_MAX_RECURSION_DEPTH );
diff --git a/include/fc/io/json_relaxed.hpp b/include/fc/io/json_relaxed.hpp
index 9a25666..00893a3 100644
--- a/include/fc/io/json_relaxed.hpp
+++ b/include/fc/io/json_relaxed.hpp
@@ -10,7 +10,6 @@
#include
#include
#include
-#include
//#include
#include
#include
@@ -24,7 +23,7 @@ namespace fc { namespace json_relaxed
variant variant_from_stream( T& in, uint32_t max_depth );
template
- fc::string tokenFromStream( T& in )
+ std::string tokenFromStream( T& in )
{
fc::stringstream token;
try
@@ -81,7 +80,7 @@ namespace fc { namespace json_relaxed
}
template
- fc::string quoteStringFromStream( T& in )
+ std::string quoteStringFromStream( T& in )
{
fc::stringstream token;
try
@@ -107,11 +106,11 @@ namespace fc { namespace json_relaxed
try
{
if( in.peek() != q )
- return fc::string();
+ return std::string();
}
catch( const fc::eof_exception& e )
{
- return fc::string();
+ return std::string();
}
// triple quote processing
@@ -186,7 +185,7 @@ namespace fc { namespace json_relaxed
}
template
- fc::string stringFromStream( T& in )
+ std::string stringFromStream( T& in )
{
try
{
@@ -294,7 +293,7 @@ namespace fc { namespace json_relaxed
};
template
- fc::variant parseInt( const fc::string& token, size_t start )
+ fc::variant parseInt( const std::string& token, size_t start )
{
static const CharValueTable ctbl;
static const uint64_t INT64_MAX_PLUS_ONE = static_cast(INT64_MAX) + 1;
@@ -336,7 +335,7 @@ namespace fc { namespace json_relaxed
}
template
- fc::variant maybeParseInt( const fc::string& token, size_t start )
+ fc::variant maybeParseInt( const std::string& token, size_t start )
{
try
{
@@ -352,7 +351,7 @@ namespace fc { namespace json_relaxed
}
template
- fc::variant parseNumberOrStr( const fc::string& token )
+ fc::variant parseNumberOrStr( const std::string& token )
{ try {
//ilog( (token) );
size_t i = 0, n = token.length();
@@ -588,7 +587,7 @@ namespace fc { namespace json_relaxed
template
variant numberFromStream( T& in )
{ try {
- fc::string token = tokenFromStream(in);
+ std::string token = tokenFromStream(in);
variant result = json_relaxed::parseNumberOrStr( token );
if( strict && !(result.is_int64() || result.is_uint64() || result.is_double()) )
FC_THROW_EXCEPTION( parse_error_exception, "expected: number" );
@@ -598,7 +597,7 @@ namespace fc { namespace json_relaxed
template
variant wordFromStream( T& in )
{
- fc::string token = tokenFromStream(in);
+ std::string token = tokenFromStream(in);
FC_ASSERT( token.length() > 0 );
diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp
index 24aff5e..052110c 100644
--- a/include/fc/io/raw.hpp
+++ b/include/fc/io/raw.hpp
@@ -50,7 +50,7 @@ namespace fc {
fc::raw::unpack( s, what, _max_depth );
fc::raw::unpack( s, msgs, _max_depth );
- e = fc::exception( fc::move(msgs), code, name, what );
+ e = fc::exception( std::move(msgs), code, name, what );
}
template
@@ -206,7 +206,7 @@ namespace fc {
template inline void pack( Stream& s, const char* v, uint32_t _max_depth )
{
FC_ASSERT( _max_depth > 0 );
- fc::raw::pack( s, fc::string(v), _max_depth - 1 );
+ fc::raw::pack( s, std::string(v), _max_depth - 1 );
}
template
@@ -270,18 +270,18 @@ namespace fc {
}
// fc::string
- template inline void pack( Stream& s, const fc::string& v, uint32_t _max_depth ) {
+ template inline void pack( Stream& s, const std::string& v, uint32_t _max_depth ) {
FC_ASSERT( _max_depth > 0 );
fc::raw::pack( s, unsigned_int(v.size()), _max_depth - 1 );
if( v.size() ) s.write( v.c_str(), v.size() );
}
- template inline void unpack( Stream& s, fc::string& v, uint32_t _max_depth ) {
+ template inline void unpack( Stream& s, std::string& v, uint32_t _max_depth ) {
FC_ASSERT( _max_depth > 0 );
std::vector tmp; fc::raw::unpack( s, tmp, _max_depth - 1 );
if( tmp.size() )
- v = fc::string( tmp.data(), tmp.data()+tmp.size() );
- else v = fc::string();
+ v = std::string( tmp.data(), tmp.data()+tmp.size() );
+ else v = std::string();
}
// bool
diff --git a/include/fc/io/raw_fwd.hpp b/include/fc/io/raw_fwd.hpp
index df80768..17f2395 100644
--- a/include/fc/io/raw_fwd.hpp
+++ b/include/fc/io/raw_fwd.hpp
@@ -1,7 +1,6 @@
#pragma once
#include
#include
-#include
#include
#include
#include
@@ -31,15 +30,11 @@ namespace fc {
namespace ip { class endpoint; }
namespace ecc { class public_key; class private_key; }
- template class fixed_string;
namespace raw {
template
inline size_t pack_size( const T& v );
- template inline void pack( Stream& s, const fc::fixed_string& u, uint32_t _max_depth=FC_PACK_MAX_DEPTH );
- template inline void unpack( Stream& s, fc::fixed_string& u, uint32_t _max_depth=FC_PACK_MAX_DEPTH );
-
template
inline void pack( Stream& s, const fc::enum_type& tp, uint32_t _max_depth=FC_PACK_MAX_DEPTH );
template