My Project
Public Member Functions | Public Attributes | List of all members
NPL::NPLFileName Struct Reference

a globally unique name of a NPL file name instance. More...

#include <NPLCommon.h>

Public Member Functions

 NPLFileName (const char *filename)
 create the NPL file name object from a string. More...
 
void SetRelativePath (const char *sPath, int nCount=-1)
 set the relaive_Path More...
 
string ToString ()
 convert to string of the following format [(sRuntimeStateName|gl)][sNID:]sRelativePath[]
 
void ToString (string &output)
 
void FromString (const char *filename)
 reset from string More...
 

Public Attributes

string sRuntimeStateName
 the runtime state name that the file belongs to. More...
 
string sNID
 the NPL runtime server ID that the file belongs to. More...
 
string sRelativePath
 the relative file path of the NPL file in the Runtime's file system. More...
 
string sDNSServerName
 the DNS file name. More...
 

Detailed Description

a globally unique name of a NPL file name instance.

The string format of an NPL file name is like below. [(sRuntimeStateName|gl)][sNID:]sRelativePath[]

Constructor & Destructor Documentation

§ NPLFileName()

NPLFileName::NPLFileName ( const char *  filename)

create the NPL file name object from a string.

The string is of the following file format

Parameters
filename[(sRuntimeStateName|gl)][sNID:]sRelativePath[] the following is a list of all valid file name combinations: "user001@paraengine.com:script/hello.lua" – a file of user001 in its default gaming thread "(world1)server001@paraengine.com:script/hello.lua" – a file of server001 in its thread world1 "(worker1)script/hello.lua" – a local file in the thread worker1 "(gl)script/hello.lua" – a glia (local) file in the current runtime state's thread "script/hello.lua" – a file in the current thread. For a single threaded application, this is usually enough.

Member Function Documentation

§ FromString()

void NPLFileName::FromString ( const char *  filename)

reset from string

See also
NPLFileName() for details.

get the activation type

get namespace, skip windows folder like "e:\\temp"

get relative path

get relative path

get DNS server name

§ SetRelativePath()

void NPLFileName::SetRelativePath ( const char *  sPath,
int  nCount = -1 
)

set the relaive_Path

Parameters
sPathwhere the path string is.
nCountthe number of characters to copy from sPath. If this is negative. the whole sPath will be read.

Member Data Documentation

§ sDNSServerName

string NPL::NPLFileName::sDNSServerName

the DNS file name.

this is a global server where the sNID can be authenticated and converted to IP/port. if empty, it first defaults to the server part of sNID, if that is empty too, default to the current one in the local runtime environment. we rarely need to explicitly specify DNS server.

§ sNID

string NPL::NPLFileName::sNID

the NPL runtime server ID that the file belongs to.

It usually represents a network endpoint (IP/port). However, instead of using IP address "192.168.0.111/60001", we usually use email like addresses, like "1001@paraengine.com" the email address will latter be resolved to IP/port. if empty, it means the local runtime environment. Specially, "all@local" means all remote NIDs connecting to this local machine.

§ sRelativePath

string NPL::NPLFileName::sRelativePath

the relative file path of the NPL file in the Runtime's file system.

it uses forward slashes such as "script/sample.lua" if empty, it defaults to "script/empty.lua"

§ sRuntimeStateName

string NPL::NPLFileName::sRuntimeStateName

the runtime state name that the file belongs to.

It usually specifies which thread the file instance is running in. If empty or "gl", it means the current or default runtime state. It must be a string with only alphabetic letters.


The documentation for this struct was generated from the following files: