NPL::NPLFileName Struct Reference

List of all members.

Detailed Description

the full name of a NPL file name


Public Member Functions

 NPLFileName (const char *filename)
 create the NPL file name object from a string.
void SetRelativePath (const char *sPath, int nCount=-1)
 set the relaive_Path
string ToString (bool bIncludeType=false)
 convert to string of the following format [ namespace : ] relativepath [ @ DNSServerName ] e.g.
void FromString (const char *filename)
 build from string: see also NPLFileName(const char * filename);

Public Attributes

string sNamespace
string sRelativePath
string sDNSServerName
bool bGlia
bool bLocal


Constructor & Destructor Documentation

NPLFileName::NPLFileName ( const char *  filename  ) 

create the NPL file name object from a string.

The string is of the following file format

Parameters:
filename,: [(g|gl|l)] [ namespace : ] relative_path [ @ DNSServerName ] the following is a list of all valid file name combinations: "NPC:NPL/CreatureA.lua@world" -- neuron file with "NPC" namespace and a specified DNS "NPC:NPL/CreatureA.lua" -- neuron file with "NPC" namespace and local DNS "(g)NPL/CreatureA.lua" -- glia file, which will be sent to UI receivers and activated from there. So one can think of the content of glia file as a bunch of UI functions. "(gl)NPL/CreatureA.lua" -- glia file forcing local activation: which will omit UI receivers and activate from local environment. "(l)NPL/CreatureA.lua" -- local neuron file: which uses no namespace and no DNS, it is just treated as a local neuron file.
[(g|gl|l)]: the "g|l" in the parenthesis denotes activation type. "g" is short for glia file. and "l" is short for local. if nothing is specified, it means neuron file. Both the neuron file and glia file can be local. A local file is always selected in the local NPL environment and execute from there. Currently, one can not specify namespace or DNS for glia file, they are always selected from the local NPL runtime environment. If nothing is specified, it all depends on the namespace section for the locality of the file.

[ namespace : ]: namespace specifies a computer on which the file is. The syntax is given by examples below: "LXZ:": a simple namespace name. A server computer can use it to refer to another server called "LXZ". "@LXZ:":a central server. A client can use it to refer to the central server on computer specified by namespace "LXZ". "player1@LXZ:": a client named player1 which is connected to central server "LXZ". Both client and server can use it to refer to a computer in the network. "all@LXZ:": all clients connected to a center. the central server can use it to broadcast messages to all clients. "@server:": the currect connected world server. A client can simply use it to refer to the current connected world server. "player1@:server": a client named player1 which is connected to the local central server. A server computer can use it to refer to one of its client. "all@server": all clients connected to the local central server. a server computer can use it to refer to all its clients. ":" or "": the local glia file if they are not specified, otherwise the g|l tag is used.

relative_path: if relative_path contains "\\", it will be converted to "/".


Member Function Documentation

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

set the relaive_Path

Parameters:
sPath,: where the path string is.
nCount,: the number of characters to copy from sPath. If this is negative. the whole sPath will be read.

string NPLFileName::ToString ( bool  bIncludeType = false  ) 

convert to string of the following format [ namespace : ] relativepath [ @ DNSServerName ] e.g.

"NPC:NPL/CreatureA.lua@world" "NPC:NPL/CreatureA.lua" "NPL/CreatureA.lua" "(gl)NPL/CreatureA.lua"

Parameters:
bIncludeType,: if true, the activation type is included, such as (gl|g|l)

void NPLFileName::FromString ( const char *  filename  ) 

build from string: see also NPLFileName(const char * filename);

get the activation type

get namespace

get relative path

get relative path

get DNS server name


Generated on Mon Dec 1 14:34:43 2008 for NPL Scripting Reference for ParaEngine by  doxygen 1.5.2