My Project
Static Public Member Functions | List of all members
NPLMono.NPLHelper Class Reference

converting XML to string and vice versa. More...

Static Public Member Functions

static string EncodeStringInQuotationFix (string str)
 this version is the same as EncodeStringInQuotation, except that it is in use on the server side. More...
 
static void EncodeStringInQuotation (ref StringBuilder buff, int nOutputOffset, string input)
 this is something like string.format("%q") in NPL. More...
 
static string EncodeStringInQuotation (string str)
 replace quotation mark in string e.g. More...
 
static bool DeserializePureNPLDataBlock (NPLLex.LexState ls, ref NPLObjectProxy objProxy)
 
static NPLObjectProxy MsgStringToNPLTable (string input)
 same as StringToNPLTable(), except that it begins with "msg={...}" More...
 
static NPLObjectProxy StringToNPLTable (string input)
 converting string to NPL table object More...
 
static bool SerializeNPLTableToString (string sStorageVar, NPLObjectProxy input, StringBuilder sCode, int nCodeOffset)
 safe convert the NPL table to string. More...
 
static bool NPLTableToString (string sStorageVar, NPLObjectProxy input, StringBuilder sCode)
 
static bool NPLTableToString (string sStorageVar, NPLObjectProxy input, StringBuilder sCode, int nCodeOffset)
 
static string EncodeStringInQuotationFix (string str)
 this version is the same as EncodeStringInQuotation, except that it is in use on the server side. More...
 
static void EncodeStringInQuotation (ref StringBuilder buff, int nOutputOffset, string input)
 this is something like string.format("%q") in NPL. More...
 
static string EncodeStringInQuotation (string str)
 replace quotation mark in string e.g. More...
 
static bool DeserializePureNPLDataBlock (NPLLex.LexState ls, ref NPLObjectProxy objProxy)
 
static NPLObjectProxy MsgStringToNPLTable (string input)
 same as StringToNPLTable(), except that it begins with "msg={...}" More...
 
static NPLObjectProxy StringToNPLTable (string input)
 converting string to NPL table object More...
 
static bool SerializeNPLTableToString (string sStorageVar, NPLObjectProxy input, StringBuilder sCode, int nCodeOffset)
 safe convert the NPL table to string. More...
 
static bool NPLTableToString (string sStorageVar, NPLObjectProxy input, StringBuilder sCode)
 
static bool NPLTableToString (string sStorageVar, NPLObjectProxy input, StringBuilder sCode, int nCodeOffset)
 

Detailed Description

converting XML to string and vice versa.

Member Function Documentation

§ DeserializePureNPLDataBlock() [1/2]

static bool NPLMono.NPLHelper.DeserializePureNPLDataBlock ( NPLLex.LexState  ls,
ref NPLObjectProxy  objProxy 
)
inlinestatic

Fixed: 2008.6.3 LiXizhi the following is for auto indexed table items {"string1", "string2\r\n", 213, nil,["A"]="B", true, false, {"another table", "field1"}}

§ DeserializePureNPLDataBlock() [2/2]

static bool NPLMono.NPLHelper.DeserializePureNPLDataBlock ( NPLLex.LexState  ls,
ref NPLObjectProxy  objProxy 
)
inlinestatic

Fixed: 2008.6.3 LiXizhi the following is for auto indexed table items {"string1", "string2\r\n", 213, nil,["A"]="B", true, false, {"another table", "field1"}}

§ EncodeStringInQuotation() [1/4]

static void NPLMono.NPLHelper.EncodeStringInQuotation ( ref StringBuilder  buff,
int  nOutputOffset,
string  input 
)
inlinestatic

this is something like string.format("%q") in NPL.

[thread-safe] replace quotation mark in string. e.g. "\" will be converted to "\"

Parameters
buffinto which buffer to write the output
nOutputOffsetthe output will be written to output[nOutputOffset]. default to 0,which is the beginning
inputthe input string to be encoded

§ EncodeStringInQuotation() [2/4]

static void NPLMono.NPLHelper.EncodeStringInQuotation ( ref StringBuilder  buff,
int  nOutputOffset,
string  input 
)
inlinestatic

this is something like string.format("%q") in NPL.

[thread-safe] replace quotation mark in string. e.g. "\" will be converted to "\"

Parameters
buffinto which buffer to write the output
nOutputOffsetthe output will be written to output[nOutputOffset]. default to 0,which is the beginning
inputthe input string to be encoded

§ EncodeStringInQuotation() [3/4]

static string NPLMono.NPLHelper.EncodeStringInQuotation ( string  str)
inlinestatic

replace quotation mark in string e.g.

"\" will be converted to "\"

Parameters
strif nil, it will return "nil"
Returns

§ EncodeStringInQuotation() [4/4]

static string NPLMono.NPLHelper.EncodeStringInQuotation ( string  str)
inlinestatic

replace quotation mark in string e.g.

"\" will be converted to "\"

Parameters
strif nil, it will return "nil"
Returns

§ EncodeStringInQuotationFix() [1/2]

static string NPLMono.NPLHelper.EncodeStringInQuotationFix ( string  str)
inlinestatic

this version is the same as EncodeStringInQuotation, except that it is in use on the server side.

the server side sees as "
". This is a client/server fix for a bug of xml transmission of in .net 2.

Parameters
str
Returns

§ EncodeStringInQuotationFix() [2/2]

static string NPLMono.NPLHelper.EncodeStringInQuotationFix ( string  str)
inlinestatic

this version is the same as EncodeStringInQuotation, except that it is in use on the server side.

the server side sees as "
". This is a client/server fix for a bug of xml transmission of in .net 2.

Parameters
str
Returns

§ MsgStringToNPLTable() [1/2]

static NPLObjectProxy NPLMono.NPLHelper.MsgStringToNPLTable ( string  input)
inlinestatic

same as StringToNPLTable(), except that it begins with "msg={...}"

Parameters
inputsuch as "msg={nid=10, name=\"value", tab={name1="value1"}}"
Returns
may return null if failed.

§ MsgStringToNPLTable() [2/2]

static NPLObjectProxy NPLMono.NPLHelper.MsgStringToNPLTable ( string  input)
inlinestatic

same as StringToNPLTable(), except that it begins with "msg={...}"

Parameters
inputsuch as "msg={nid=10, name=\"value", tab={name1="value1"}}"
Returns
may return null if failed.

§ SerializeNPLTableToString() [1/2]

static bool NPLMono.NPLHelper.SerializeNPLTableToString ( string  sStorageVar,
NPLObjectProxy  input,
StringBuilder  sCode,
int  nCodeOffset 
)
inlinestatic

safe convert the NPL table to string.

if the input is nil, output is not assigned.

Parameters
sStorageVarif null, output is pure table{}, otherwise it is sStorageVar={}
input
sCode
nCodeOffset
Returns
true if input is a string object and value is written to output.

§ SerializeNPLTableToString() [2/2]

static bool NPLMono.NPLHelper.SerializeNPLTableToString ( string  sStorageVar,
NPLObjectProxy  input,
StringBuilder  sCode,
int  nCodeOffset 
)
inlinestatic

safe convert the NPL table to string.

if the input is nil, output is not assigned.

Parameters
sStorageVarif null, output is pure table{}, otherwise it is sStorageVar={}
input
sCode
nCodeOffset
Returns
true if input is a string object and value is written to output.

§ StringToNPLTable() [1/2]

static NPLObjectProxy NPLMono.NPLHelper.StringToNPLTable ( string  input)
inlinestatic

converting string to NPL table object

Parameters
inputsuch as "{nid=10, name=\"value", tab={name1="value1"}}"
Returns
may return null if failed.

§ StringToNPLTable() [2/2]

static NPLObjectProxy NPLMono.NPLHelper.StringToNPLTable ( string  input)
inlinestatic

converting string to NPL table object

Parameters
inputsuch as "{nid=10, name=\"value", tab={name1="value1"}}"
Returns
may return null if failed.

The documentation for this class was generated from the following file: