I am making a class and I want to return my class inside the method. My class has a rapidjson::Document object.
You can see previous issues here: LNK2019: "Unresolved external character" with rapidjson
As I discovered, quickjson prevents you from executing any copy of the Document object, and then the default copy of the class containing the Document object failed. I am trying to define my own copy constructor, but I need to execute a copy of the object. I saw a way to hypothetically copy an object using the .Accept() method, but it returns me a lot of errors inside the rapidjson::Document class:
error C2248: 'cannot access the private member declared in the class `rapidjson :: GenericDocument'
This is my copy constructor:
jsonObj::jsonObj(jsonObj& other) { jsonStr = other.jsonStr; message = other.message;
I found in the library code (line 52-54) that " Copy constructor is not permitted ".
This is my class:
class jsonObj { string jsonStr; Document doc; public: jsonObj(string json); jsonObj(jsonObj& other); string getJsonStr(); };
Method:
jsonObj testOBJ() { string json = "{error:null, message:None, errorMessage:MoreNone}"; jsonObj b(json); return b;
So how to make a copy of the Document element?
source share