Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Encoder
- {
- private:
- rapidjson::Document json;
- public:
- Encoder();
- ~Encoder();
- bool load(std::string path);
- std::string get_value_by_key(const char* key);
- std::string encode_str(const char* input);
- };
- ...
- std::string Encoder::get_value_by_key(const char* key)
- {
- rapidjson::Value& s = json[key];
- return s.GetString();
- }
- std::string Encoder::encode_str(const char* input){
- for (int i = 0; i < strLength(input); i++)
- {
- std::stringstream tmp;
- tmp.str("");
- tmp << input[i];
- std::cout << get_value_by_key(tmp.str().c_str()) << std::endl;
- }
- //std::cout << input << std::endl;
- return "ok";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement