This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct frame_type final | |
| { | |
| size_t get_frame_size() const | |
| { return sizeof( frame_type ) - 1 + data_size; } | |
| some_type1 some_header1; | |
| some_type2 some_header2; | |
| size_t data_size = 0; | |
| array< uint8_t, 0 > data; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 小さなサンプルアプリ作る | |
| ↓ | |
| でもまあロガーくらい入れて作りたい | |
| ↓ | |
| boost::log入れるのめんどくさいしちょっとしたやつ | |
| ↓ | |
| 気づけばいつものロガーコードを書いている |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include "type.hxx" | |
| namespace usagi::json::picojson | |
| { | |
| static inline auto to_bool( const boolean_type in ) { return in; } | |
| /// @note ECMA-262 NaN: Boolean( 0/0 ) -> false | |
| /// @note ECMA-262 +Inf: Boolean( +1/0 ) -> true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <picojson.h> | |
| #include <string> | |
| namespace usagi::json::picojson | |
| { | |
| using object_type = ::picojson::object; | |
| using array_type = ::picojson::array; | |
| using value_type = ::picojson::value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <usagi/json/picojson/rpc/jsonrpc20.hxx> | |
| #include <memory> | |
| auto main() -> int | |
| { | |
| using namespace usagi::json::picojson; | |
| using namespace usagi::json::picojson::rpc::jsonrpc20; | |
| server_type s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install mono-complete fsharp nuget |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// @brief object_type に対しドット区切りのパスで object_type の階層を必要なら作成しながら辿り末梢の要素の参照を返す | |
| static inline decltype( auto ) make_object_path | |
| ( object_type& root_object | |
| , const std::string& dot_separated_path | |
| ) | |
| { | |
| // (1) ドット区切りのパス文字列を階層ごとに分離する機能 | |
| std::vector< std::string > path; | |
| boost::split( path, dot_separated_path, boost::is_any_of( "." ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd /usr/local/bin | |
| sudo ln -s /usr/share/code/bin/code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 理想: picojson には実装されていないが時折欲しくなる使用例 | |
| const auto element_value = root_value.[ "aaa.bbb.ccc" ].as< double >(); | |
| // 現実: 毎度こんなに書きたくない | |
| const double element_value | |
| try | |
| { | |
| element_value = | |
| root_value.get< picojson::object >().at( "aaa" ) | |
| .get< picojson::object >().at( "bbb" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ...include/boost/asio/ssl/impl/context.ipp: In destructor 'boost::asio::ssl::context::~context()': | |
| .../include/boost/asio/ssl/impl/context.ipp:232:25: error: '::SSL_CTX_get_default_passwd_cb_userdata' has not been declared | |
| void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); | |
| ^~ |