C# Class NPLMono.NPLHelper

Afficher le fichier Open project: LiXizhi/NPLRuntime

Méthodes publiques

Méthode 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 méthode

public static DeserializePureNPLDataBlock ( NPLLex ls, NPLObjectProxy &objProxy ) : bool
ls NPLLex
objProxy NPLObjectProxy
Résultat bool

EncodeStringInQuotation() public static méthode

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"
Résultat string

EncodeStringInQuotation() public static méthode

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
Résultat void

EncodeStringInQuotationFix() public static méthode

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
Résultat string

MsgStringToNPLTable() public static méthode

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\"}}"
Résultat NPLObjectProxy

NPLTableToString() public static méthode

public static NPLTableToString ( string sStorageVar, NPLObjectProxy input, StringBuilder sCode ) : bool
sStorageVar string
input NPLObjectProxy
sCode StringBuilder
Résultat bool

NPLTableToString() public static méthode

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

SerializeNPLTableToString() public static méthode

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
Résultat bool

StringToNPLTable() public static méthode

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