C# Class NPLMono.NPLHelper

显示文件 Open project: LiXizhi/NPLRuntime

Public Methods

Method Description
DeserializePureNPLDataBlock ( NPLLex ls, NPLObjectProxy &objProxy ) : bool
EncodeStringInQuotation ( string str ) : string

replace quotation mark in string e.g. "\" will be converted to \"\\\"

EncodeStringInQuotation ( StringBuilder &buff, int nOutputOffset, string input ) : void

this is something like string.format("%q") in NPL. [thread-safe] replace quotation mark in string. e.g. "\" will be converted to \"\\\"

EncodeStringInQuotationFix ( string str ) : string

this version is the same as EncodeStringInQuotation, except that it is in use on the server side. the server side sees \r as " ". This is a client/server fix for a bug of xml transmission of \r in .net 2.

MsgStringToNPLTable ( string input ) : NPLObjectProxy

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

NPLTableToString ( string sStorageVar, NPLObjectProxy input, StringBuilder sCode ) : bool
NPLTableToString ( string sStorageVar, NPLObjectProxy input, StringBuilder sCode, int nCodeOffset ) : bool
SerializeNPLTableToString ( string sStorageVar, NPLObjectProxy input, StringBuilder sCode, int nCodeOffset ) : bool

safe convert the NPL table to string. if the input is nil, output is not assigned.

StringToNPLTable ( string input ) : NPLObjectProxy

converting string to NPL table object

Method Details

DeserializePureNPLDataBlock() public static method

public static DeserializePureNPLDataBlock ( NPLLex ls, NPLObjectProxy &objProxy ) : bool
ls NPLLex
objProxy NPLObjectProxy
return bool

EncodeStringInQuotation() public static method

replace quotation mark in string e.g. "\" will be converted to \"\\\"
public static EncodeStringInQuotation ( string str ) : string
str string if nil, it will return "nil"
return string

EncodeStringInQuotation() public static method

this is something like string.format("%q") in NPL. [thread-safe] replace quotation mark in string. e.g. "\" will be converted to \"\\\"
public static EncodeStringInQuotation ( StringBuilder &buff, int nOutputOffset, string input ) : void
buff StringBuilder into which buffer to write the output
nOutputOffset int the output will be written to output[nOutputOffset]. default to 0,which is the beginning
input string the input string to be encoded
return void

EncodeStringInQuotationFix() public static method

this version is the same as EncodeStringInQuotation, except that it is in use on the server side. the server side sees \r as " ". This is a client/server fix for a bug of xml transmission of \r in .net 2.
public static EncodeStringInQuotationFix ( string str ) : string
str string
return string

MsgStringToNPLTable() public static method

same as StringToNPLTable(), except that it begins with "msg={...}"
public static MsgStringToNPLTable ( string input ) : NPLObjectProxy
input string such as "msg={nid=10, name=\"value\", tab={name1=\"value1\"}}"
return NPLObjectProxy

NPLTableToString() public static method

public static NPLTableToString ( string sStorageVar, NPLObjectProxy input, StringBuilder sCode ) : bool
sStorageVar string
input NPLObjectProxy
sCode StringBuilder
return bool

NPLTableToString() public static method

public static NPLTableToString ( string sStorageVar, NPLObjectProxy input, StringBuilder sCode, int nCodeOffset ) : bool
sStorageVar string
input NPLObjectProxy
sCode StringBuilder
nCodeOffset int
return bool

SerializeNPLTableToString() public static method

safe convert the NPL table to string. if the input is nil, output is not assigned.
public static SerializeNPLTableToString ( string sStorageVar, NPLObjectProxy input, StringBuilder sCode, int nCodeOffset ) : bool
sStorageVar string if null, output is pure table{}, otherwise it is sStorageVar={}
input NPLObjectProxy
sCode StringBuilder
nCodeOffset int
return bool

StringToNPLTable() public static method

converting string to NPL table object
public static StringToNPLTable ( string input ) : NPLObjectProxy
input string such as "{nid=10, name=\"value\", tab={name1=\"value1\"}}"
return NPLObjectProxy