helper functions for editing.
More...
#include <EditorHelper.h>
|
static bool | SearchFileNameInScript (string &output, const char *sScript, bool bRelativePath=true) |
| return the file name from a given script text. More...
|
|
static const char * | SearchFileNameInScript_ (const char *sScript, bool bRelativePath) |
| same as SearchFileNameInScript(). More...
|
|
static bool | OpenWithDefaultEditor (const char *sFilename, bool bWaitOnReturn=false) |
| Open a given file with the default registered editor in the game engine. More...
|
|
static bool | CreateEmptyCharacterEventFile (const char *sScriptFile, const char *sName) |
| create an empty character event file with empty event handlers More...
|
|
static bool | CreateProcess (const char *lpApplicationName, const char *lpCommandLine, bool bWaitOnReturn=false) |
| run an external application. More...
|
|
static bool | ShellExecute (const char *lpOperation, const char *lpFile, const char *lpParameters, const char *lpDirectory, int nShowCmd) |
| Performs an operation on a specified file. More...
|
|
helper functions for editing.
It is a group of static helper functions for scene editing.
§ CreateEmptyCharacterEventFile()
bool CEditorHelper::CreateEmptyCharacterEventFile |
( |
const char * |
sScriptFile, |
|
|
const char * |
sName |
|
) |
| |
|
static |
create an empty character event file with empty event handlers
- Parameters
-
sScriptFile | the script file to be created. |
sName | the character name. |
- Returns
- : return true if file is created. return false, if the file already exists, or failed creating the new file.
§ CreateProcess()
bool CEditorHelper::CreateProcess |
( |
const char * |
lpApplicationName, |
|
|
const char * |
lpCommandLine, |
|
|
bool |
bWaitOnReturn = false |
|
) |
| |
|
static |
run an external application.
creates a new process and its primary thread. The new process runs the specified executable file in the security context of the calling process.
- Parameters
-
lpApplicationName:Pointer | to a null-terminated string that specifies the module to execute. The specified module can be a Windows-based application. The string can specify the full path and file name of the module to execute or it can specify a partial name. In the case of a partial name, the function uses the current drive and current directory to complete the specification. The function will not use the search path. If the file name does not contain an extension, .exe is assumed. If the executable module is a 16-bit application, lpApplicationName should be NULL, and the string pointed to by lpCommandLine should specify the executable module as well as its arguments. |
lpCommandLine:Pointer | to a null-terminated string that specifies the command line to execute. |
bWaitOnReturn | if false, the function returns immediately; otherwise it will wait for the editor to return. if this is true, the Child Process will have Redirected Input and Output to current log file. |
- Returns
- true if opened.
§ OpenWithDefaultEditor()
bool CEditorHelper::OpenWithDefaultEditor |
( |
const char * |
sFilename, |
|
|
bool |
bWaitOnReturn = false |
|
) |
| |
|
static |
Open a given file with the default registered editor in the game engine.
- Parameters
-
sFileName | file name to be opened by the default editor. |
bWaitOnReturn | if false, the function returns immediately; otherwise it will wait for the editor to return. |
- Returns
- true if opened.
§ SearchFileNameInScript()
bool CEditorHelper::SearchFileNameInScript |
( |
string & |
output, |
|
|
const char * |
sScript, |
|
|
bool |
bRelativePath = true |
|
) |
| |
|
static |
return the file name from a given script text.
It searches "NPL.load(\"" in the script text, and returns its first string parameter.
- Parameters
-
output | output file name |
sScript | script text. if the file name is not found within the first MAX_PATH=260 characters, "" is returned. |
bRelativePath | if true, relative path is returned. if false, the complete NPL path in the script is returned, which may contain (gl) prefix. |
- Returns
- : true if found.
§ SearchFileNameInScript_()
const char * CEditorHelper::SearchFileNameInScript_ |
( |
const char * |
sScript, |
|
|
bool |
bRelativePath |
|
) |
| |
|
static |
§ ShellExecute()
bool CEditorHelper::ShellExecute |
( |
const char * |
lpOperation, |
|
|
const char * |
lpFile, |
|
|
const char * |
lpParameters, |
|
|
const char * |
lpDirectory, |
|
|
int |
nShowCmd |
|
) |
| |
|
static |
Performs an operation on a specified file.
e.g. ShellExecute("open", "iexplore.exe", "http://www.paraengine.com", NULL, 1);
- Parameters
-
lpOperation:[in] | Pointer to a null-terminated string,
- "wait" this is a special one that uses ShellExecuteEx to wait on the process to terminate before return
- "edit" Launches an editor and opens the document for editing. If lpFile is not a document file, the function will fail.
- "explore" Explores the folder specified by lpFile.
- "find" Initiates a search starting from the specified directory.
- "open" Opens the file specified by the lpFile parameter. The file can be an executable file, a document file, or a folder.
- "print" Prints the document file specified by lpFile. If lpFile is not a document file, the function will fail.
- NULL For systems prior to Microsoft Windows 2000, the default verb is used if it is valid and available in the registry. If not, the "open" verb is used.
|
lpFile | [in] Pointer to a null-terminated string that specifies the file or object on which to execute the specified verb. To specify a Shell namespace object, pass the fully qualified parse name. Note that not all verbs are supported on all objects. For example, not all document types support the "print" verb. |
lpParameters[in] | If the lpFile parameter specifies an executable file, lpParameters is a pointer to a null-terminated string that specifies the parameters to be passed to the application. The format of this string is determined by the verb that is to be invoked. If lpFile specifies a document file, lpParameters should be NULL. |
lpDirectory | [in] Pointer to a null-terminated string that specifies the default directory. |
nShowCmd | [in] Flags that specify how an application is to be displayed when it is opened. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it.
- #define SW_HIDE 0
- #define SW_NORMAL 1
- #define SW_MAXIMIZE 3
- #define SW_SHOW 5
- #define SW_MINIMIZE 6
- #define SW_RESTORE 9
|
The documentation for this class was generated from the following files:
- Client/trunk/ParaEngineClient/Engine/EditorHelper.h
- Client/trunk/ParaEngineClient/Engine/EditorHelper.cpp