|
| NPLWriter (int nReservedSize) |
| the internal buffer reserved size. More...
|
|
| NPLWriter (StringBuilder buff_) |
|
void | Reset () |
|
void | Reset (int nReservedSize) |
|
void | WriteName (string name) |
|
void | WriteName (string name, bool bUseBrackets) |
| write a parameter name More...
|
|
void | WriteValue (string value) |
|
void | WriteValue (string value, bool bInQuotation) |
| rite a parameter value More...
|
|
void | WriteValue (double value) |
|
void | WriteNil () |
|
void | WriteParamDelimiter () |
|
void | Append (string sText) |
| append any text More...
|
|
void | BeginTable () |
|
void | EndTable () |
|
override string | ToString () |
| get the current NPL code. More...
|
|
| NPLWriter (int nReservedSize) |
| the internal buffer reserved size. More...
|
|
| NPLWriter (StringBuilder buff_) |
|
void | Reset () |
|
void | Reset (int nReservedSize) |
|
void | WriteName (string name) |
|
void | WriteName (string name, bool bUseBrackets) |
| write a parameter name More...
|
|
void | WriteValue (string value) |
|
void | WriteValue (string value, bool bInQuotation) |
| rite a parameter value More...
|
|
void | WriteValue (double value) |
|
void | WriteNil () |
|
void | WriteParamDelimiter () |
|
void | Append (string sText) |
| append any text More...
|
|
void | BeginTable () |
|
void | EndTable () |
|
override string | ToString () |
| get the current NPL code. More...
|
|
a simple class for creating NPL script code, especially data table code.
this class is reentrant (thread-safe). Please note that this class does not ensure that the code is a pure table. See Example: // to generate the string : msg={name=1,2,{"3"="4",},}; NPLWriter writer = new NPLWriter(); writer.WriteName("msg"); writer.BeginTable(); writer.WriteName("name"); writer.WriteValue(1); writer.WriteValue(2); writer.BeginTable(); writer.WriteName("3", true); writer.WriteValue("4"); writer.EndTable(); writer.EndTable(); writer.WriteParamDelimiter(); ParaGlobal.log(writer.ToString());
One can also provide their own string buffer to write to, like below. StringBuilder buff = new StringBuilder(); buff.EnsureCapacity(100); NPLWriter writer = new NPLWriter(buff);