|
My Project
|
#include <NPLInterface.hpp>
Public Member Functions | |
| NPLObjectProxyT (NPLObjectBase *pObject) | |
| operator double () | |
| void | operator= (double value) |
| operator bool () | |
| void | operator= (bool value) |
| operator const string & () | |
| bool | operator== (const string &value) |
| bool | operator== (const char *value) |
| void | operator= (const std::string &value) |
| void | operator= (const char *value) |
| NPLObjectProxyT & | operator[] (const string &sName) |
| NPLObjectProxyT & | operator[] (const char *sName) |
| NPLObjectProxyT & | operator[] (int nIndex) |
| NPLObjectProxyT | GetField (const string &sName) |
| NPLObjectProxyT | GetField (const char *sName) |
| void | MakeNil () |
| T::Iterator_Type | begin () |
| T::Iterator_Type | end () |
| T::IndexIterator_Type | index_begin () |
| T::IndexIterator_Type | index_end () |
| NPLObjectBase::NPLObjectType | GetType () |
| get the type | |
NPL object proxy.
This is both a smart pointer and accessors Example 1: Create NPLTable and serialize to string NPLObjectProxy msg; msg["nid"] = (double)10; msg["name"] = "value"; msg["tab"]["name1"] = "value1"; NPLHelper::SerializeNPLTableToString(NULL, msg, strOutput);
Example 2: deserialize NPLTable from string.
NPLObjectProxy tabMsg = NPLHelper::StringToNPLTable("{nid=10, name=\"value\", tab={name1=\"value1\"}}");
assert((double)tabMsg["nid"] == 10);
assert((tabMsg["name"]) == "value");
assert((tabMsg["tab"]["name1"]) == "value1");
1.8.12