This documentation describes the Prokee module interface.
Templates
Show templates with parameter T set to: (
T) -- (
char) -- (
wchar_t)
Static Methods:
main
main
int path::main(int argc,char **argv)
Static Template Methods:
pathtype
pathtype (version 5)
int path::pathtype(const wchar_t *path,const wchar_t *dirsep,const wchar_t *labelsep)
pathtype (version 6)
int path::pathtype(const wchar_t *path,const wchar_t *dirsep,const wchar_t *labelsep,const wchar_t *rootsym)
onopath
fnopath
dnopath
pnopath
sxopath
sxopath (version 2)
const wchar_t *path::sxopath(const wchar_t *path,wchar_t dirsep,wchar_t labelsep,wchar_t susep)
sxopath (version 3)
const wchar_t *path::sxopath(const wchar_t *path,const wchar_t *dirsep,const wchar_t *labelsep,const wchar_t *susep)
sxopath (version 4)
const wchar_t *path::sxopath(const wchar_t *path,const wchar_t *dirsep,const wchar_t *labelsep,const wchar_t *susep,const wchar_t *rootsym)
makeabspath
testpath
testpath
bool path::testpath(const wchar_t *path)
copy
copy (version 1)
bool path::copy(const wchar_t *targetpath,const wchar_t *sourcepath)
copy (version 2)
bool path::copy(const wchar_t *targetpath,const wchar_t *sourcepath,const wchar_t *object)
copy (version 3)
bool path::copy(const wchar_t *targetpath,const wchar_t *sourcepath,CondCopyControl< wchar_t > *ccc)
copy (version 4)
bool path::copy(const wchar_t *targetpath,const wchar_t *sourcepath,const wchar_t *object,CondCopyControl< wchar_t > *ccc)
pathcmp
compresspath
Motivation
The module path provides functions for manipulating strings which hold paths.
A path may relate to a path within the file system, but can also represent a path within a graph. This module handles paths, which are provided as a null-terminated string.
Types of Paths
1) Absolute and Relative Paths
-
An absolute path starts with a label, or with the root symbol.
Examples:
C:/Users/peter/
/usr/local/bin/
-
Relative paths are paths which are not absolute paths.
Examples:
../test/info.txt
images/map.png
2) The type of a path with regard to the object the path points to.
| The type of object the path points to |
Examples |
Description |
| file |
C:/Users/peter/info.txt
/users/peter/info.txt
|
A path to a file is every path which is not considered pointing to a directory.
|
| directory |
C:/Users/peter/
/home/peter/
../test/
|
A path to a directory is a path which ends with a special character. F.e. the character / (or \ on Windows) used for paths in file systems.
|
| label |
C:/
C:
http://
Extras Disk:
|
A label-path either points to the root directory of a labelled file system (C:/) or to the label itself (C:). But only paths which consist of only one named component (the name of the label) are considered label-paths.
|
Static Methods
main
...
See
Commandline-Interface.
Signature:
int path::main(int argc,char **argv)
Parameters:
| int | argc | | The number of command-line parameters. |
| char ** | argv | [IN] | The command-line parameters. |
Return value:Exit status.
getProkeeInstallDirectory
Returns the absolute path to the prokee installation directory.
Signature:
char *path::getProkeeInstallDirectory(unsigned int extra_length)
Parameters:
| unsigned int | extra_length | | |
getProkeeWorkingDirectory
Returns the absolute path to the prokee working directory.
Signature:
char *path::getProkeeWorkingDirectory(unsigned int extra_length)
Parameters:
| unsigned int | extra_length | | |
Static Template Methods
pathtype (version 1)
Determines if a string specifies an absolute or relative path and if it is a path to a file or a path to a directory (or a path which contains only a label). See section
Types of Paths for more information.
Signature:
int path::pathtype(const wchar_t *path)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
Return value:Returns the type of the path.
|
|
absolute path
|
relative path
|
|
file
|
1
|
0
|
|
directory
|
3
|
2
|
|
label
|
5 or 7
|
-
|
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
pathtype (version 2)
Determines if a string specifies an absolute or relative path and if it is a path to a file or a path to a directory (or a path which contains only a label). See section
Types of Paths for more information.
Signature:
int path::pathtype(const wchar_t *path,int system)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| int | system | | Specifies the format of the path according to the operating system. Set this value to 1 for paths on Unix and 2 for paths on Windows files systems. |
Return value:Returns the type of the path.
|
|
absolute path
|
relative path
|
|
file
|
1
|
0
|
|
directory
|
3
|
2
|
|
label
|
5 or 7
|
-
|
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
pathtype (version 3)
Determines if a string specifies an absolute or relative path and if it is a path to a file or a path to a directory (or a path which contains only a label). See section
Types of Paths for more information.
Signature:
int path::pathtype(const wchar_t *path,wchar_t dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| wchar_t | dirsep | | The symbol used to separate directory names. |
Return value:Returns the type of the path.
|
|
absolute path
|
relative path
|
|
file
|
1
|
0
|
|
directory
|
3
|
2
|
|
label
|
5 or 7
|
-
|
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
pathtype (version 4)
Determines if a string specifies an absolute or relative path and if it is a path to a file or a path to a directory (or a path which contains only a label). See section
Types of Paths for more information.
Signature:
int path::pathtype(const wchar_t *path,wchar_t dirsep,wchar_t labelsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| wchar_t | dirsep | | The symbol used to separate directory names. |
| wchar_t | labelsep | | The symbol used to mark the end of the label. |
Return value:Returns the type of the path.
|
|
absolute path
|
relative path
|
|
file
|
1
|
0
|
|
directory
|
3
|
2
|
|
label
|
5 or 7
|
-
|
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
pathtype (version 5)
Determines if a string specifies an absolute or relative path and if it is a path to a file or a path to a directory (or a path which contains only a label). See section
Types of Paths for more information.
Signature:
int path::pathtype(const wchar_t *path,const wchar_t *dirsep,const wchar_t *labelsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
| const wchar_t * | labelsep | [IN] | The symbols used to mark the end of the label. |
Return value:Returns the type of the path.
|
|
absolute path
|
relative path
|
|
file
|
1
|
0
|
|
directory
|
3
|
2
|
|
label
|
5 or 7
|
-
|
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
pathtype (version 6)
Determines if a string specifies an absolute or relative path and if it is a path to a file or a path to a directory (or a path which contains only a label). See section
Types of Paths for more information.
Signature:
int path::pathtype(const wchar_t *path,const wchar_t *dirsep,const wchar_t *labelsep,const wchar_t *rootsym)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
| const wchar_t * | labelsep | [IN] | The symbols used to mark the end of the label. |
| const wchar_t * | rootsym | [IN] | The symbols used for root. |
Return value:Returns the type of the path.
|
|
absolute path
|
relative path
|
|
file
|
1
|
0
|
|
directory
|
3
|
2
|
|
label
|
5 or 7
|
-
|
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
onopath (version 1)
Returns a pointer to the object the path points to. This is the last named component of the path.
Signature:
const wchar_t *path::onopath(const wchar_t *path)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
Return value:Returns a pointer to the first character of the last named component within the path string.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
onopath (version 2)
Returns a pointer to the object the path points to. This is the last named component of the path.
Signature:
const wchar_t *path::onopath(const wchar_t *path,wchar_t dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| wchar_t | dirsep | | The symbol used to separate directory names. |
Return value:Returns a pointer to the first character of the last named component within the path string.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
onopath (version 3)
Returns a pointer to the object the path points to. This is the last named component of the path.
Signature:
const wchar_t *path::onopath(const wchar_t *path,const wchar_t *dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
Return value:Returns a pointer to the first character of the last named component within the path string.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
fnopath (version 1)
Returns a pointer to the file-name the path points to.
Signature:
const wchar_t *path::fnopath(const wchar_t *path)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
Return value:Returns a pointer to the first character of the file-name.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
fnopath (version 2)
Returns a pointer to the file-name the path points to.
Signature:
const wchar_t *path::fnopath(const wchar_t *path,wchar_t dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| wchar_t | dirsep | | The symbol used to separate directory names. |
Return value:Returns a pointer to the first character of the file-name.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
fnopath (version 3)
Returns a pointer to the file-name the path points to.
Signature:
const wchar_t *path::fnopath(const wchar_t *path,const wchar_t *dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
Return value:Returns a pointer to the first character of the file-name.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
dnopath (version 1)
Returns the path to the directory the path points to. If the path is a path to a directory, this function returns a copy of the path. If it is a path to a file, the function returns the path to the directory of this file.
Signature:
wchar_t *path::dnopath(const wchar_t *path)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
Return value:Returns a pointer to the newly allocated buffer, that holds the path to the directory.
Remarks:
The application has to free the returned buffer.
dnopath (version 2)
Returns the path to the directory the path points to. If the path is a path to a directory, this function returns a copy of the path. If it is a path to a file, the function returns the path to the directory of this file.
Signature:
wchar_t *path::dnopath(const wchar_t *path,wchar_t dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| wchar_t | dirsep | | The symbol used to separate directory names. |
Return value:Returns a pointer to the newly allocated buffer, that holds the path to the directory.
Remarks:
The application has to free the returned buffer.
dnopath (version 3)
Returns the path to the directory the path points to. If the path is a path to a directory, this function returns a copy of the path. If it is a path to a file, the function returns the path to the directory of this file.
Signature:
wchar_t *path::dnopath(const wchar_t *path,const wchar_t *dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
Return value:Returns a pointer to the newly allocated buffer, that holds the path to the directory.
Remarks:
The application has to free the returned buffer.
pnopath (version 1)
Returns the path to the parent directory.
Signature:
wchar_t *path::pnopath(const wchar_t *path)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
Return value:Returns a pointer to the newly allocated buffer, that holds the path to the parent directory.
Remarks:
The application has to free the returned buffer.
pnopath (version 2)
Returns the path to the parent directory.
Signature:
wchar_t *path::pnopath(const wchar_t *path,wchar_t dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| wchar_t | dirsep | | The symbol used to separate directory names. |
Return value:Returns a pointer to the newly allocated buffer, that holds the path to the parent directory.
Remarks:
The application has to free the returned buffer.
pnopath (version 3)
Returns the path to the parent directory.
Signature:
wchar_t *path::pnopath(const wchar_t *path,const wchar_t *dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
Return value:Returns a pointer to the newly allocated buffer, that holds the path to the parent directory.
Remarks:
The application has to free the returned buffer.
sxopath (version 1)
Returns a pointer to the file extension.
Signature:
const wchar_t *path::sxopath(const wchar_t *path)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
Return value:Returns a pointer to the first character of the file-extension.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
sxopath (version 2)
Returns a pointer to the file extension.
Signature:
const wchar_t *path::sxopath(const wchar_t *path,wchar_t dirsep,wchar_t labelsep,wchar_t susep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| wchar_t | dirsep | | The symbol used to separate directory names. |
| wchar_t | labelsep | | The symbol used to mark the end of the label. |
| wchar_t | susep | | The symbol used to mark the beginning of the file extension. |
Return value:Returns a pointer to the first character of the file-extension.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
sxopath (version 3)
Returns a pointer to the file extension.
Signature:
const wchar_t *path::sxopath(const wchar_t *path,const wchar_t *dirsep,const wchar_t *labelsep,const wchar_t *susep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
| const wchar_t * | labelsep | [IN] | The symbols used to mark the end of the label. |
| const wchar_t * | susep | [IN] | The symbols used to mark the beginning of the file extension. |
Return value:Returns a pointer to the first character of the file-extension.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
sxopath (version 4)
Returns a pointer to the file extension.
Signature:
const wchar_t *path::sxopath(const wchar_t *path,const wchar_t *dirsep,const wchar_t *labelsep,const wchar_t *susep,const wchar_t *rootsym)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
| const wchar_t * | labelsep | [IN] | The symbols used to mark the end of the label. |
| const wchar_t * | susep | [IN] | The symbols used to mark the beginning of the file extension. |
| const wchar_t * | rootsym | [IN] | The symbols used for root. |
Return value:Returns a pointer to the first character of the file-extension.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
makeabspath (version 1)
Constructs the absolute path.
Signature:
wchar_t *path::makeabspath(const wchar_t *path)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
Return value:Returns the absolute path.
makeabspath (version 2)
Constructs the absolute path.
Signature:
wchar_t *path::makeabspath(const wchar_t *path,const wchar_t *cd)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | cd | [IN] | The current working directory (as null-terminated string). |
Return value:Returns the absolute path.
makeabspath (version 3)
Constructs the absolute path.
Signature:
wchar_t *path::makeabspath(const wchar_t *path,const wchar_t *cd,const wchar_t *dirsep)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
| const wchar_t * | cd | [IN] | The current working directory (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
Return value:Returns the absolute path.
testpath
Tests if a path exists.
Signature:
bool path::testpath(const wchar_t *path)
Parameters:
| const wchar_t * | path | [IN] | The path (as null-terminated string). |
Return value:Returns
true, if the path exists and
false otherwise.
Required code:

function
copyfile from module
file (version 1 - 0 -- default: v01)

function
copydir from module
dir (version 1 - 0 -- default: v01)
copy (version 1)
Copies the content from sourcepath to targetpath.
Signature:
bool path::copy(const wchar_t *targetpath,const wchar_t *sourcepath)
Parameters:
| const wchar_t * | targetpath | [IN] | The path (as null-terminated string). |
| const wchar_t * | sourcepath | [IN] | The path (as null-terminated string). |
Return value:Returns
true, if successful and otherwise
false.
Required code:

function
copyfile from module
file (version 1 - 0 -- default: v01)

function
copydir from module
dir (version 1 - 0 -- default: v01)
copy (version 2)
Copies the content from sourcepath to targetpath.
Signature:
bool path::copy(const wchar_t *targetpath,const wchar_t *sourcepath,const wchar_t *object)
Parameters:
| const wchar_t * | targetpath | [IN] | The path (as null-terminated string). |
| const wchar_t * | sourcepath | [IN] | The path (as null-terminated string). |
| const wchar_t * | object | [IN] | The name of the object (as null-terminated string). |
Return value:Returns
true, if successful and otherwise
false.
Required code:

function
copyfile from module
file (version 1 - 0 -- default: v01)

function
copydir from module
dir (version 1 - 0 -- default: v01)
copy (version 3)
Copies the content from sourcepath to targetpath.
Signature:
bool path::copy(const wchar_t *targetpath,const wchar_t *sourcepath,CondCopyControl< wchar_t > *ccc)
Parameters:
| const wchar_t * | targetpath | [IN] | The path (as null-terminated string). |
| const wchar_t * | sourcepath | [IN] | The path (as null-terminated string). |
| CondCopyControl< wchar_t > * | ccc | [IN] | Pointer to an instance of an implementation of CondCopyControl. See file:CondCopyControl. |
Return value:Returns
true, if successful and otherwise
false.
Required code:

function
copyfile from module
file (version 1 - 0 -- default: v01)

function
copydir from module
dir (version 1 - 0 -- default: v01)
copy (version 4)
Copies the content from sourcepath to targetpath.
Signature:
bool path::copy(const wchar_t *targetpath,const wchar_t *sourcepath,const wchar_t *object,CondCopyControl< wchar_t > *ccc)
Parameters:
| const wchar_t * | targetpath | [IN] | The path (as null-terminated string). |
| const wchar_t * | sourcepath | [IN] | The path (as null-terminated string). |
| const wchar_t * | object | [IN] | The name of the object (as null-terminated string). |
| CondCopyControl< wchar_t > * | ccc | [IN] | Pointer to an instance of an implementation of CondCopyControl. See file:CondCopyControl. |
Return value:Returns
true, if successful and otherwise
false.
Required code:

function
copyfile from module
file (version 1 - 0 -- default: v01)

function
copydir from module
dir (version 1 - 0 -- default: v01)
pathcmp (version 1)
Compares two paths, if they are equal.
You may want to call
compresspath() bevore calling pathcmp().
pathcmp("test/sub/../","test/") returns false.
pathcmp(compresspath("test/sub/../"),"test/") returns true.
Mind that the paths
test/ and
test are not equal.
The method
makeabspath() may be helpful to compare paths of the actual file system.
Signature:
bool path::pathcmp(const wchar_t *path_a,const wchar_t *path_b)
Parameters:
| const wchar_t * | path_a | [IN] | The path (as null-terminated string). |
| const wchar_t * | path_b | [IN] | The path (as null-terminated string). |
Return value:Returns
true, if both paths are identical, and otherwise
false.
Required code:

function
matchsymbol from module
strman (version 1 - 0 -- default: v01)
compresspath (version 1)
Simplifies a path by removing
./ and
../ from the path where possible. (One or more
../ directories at the beginning of the path are not removed.)
This is not jet correctly implemented!
Signature:
wchar_t *path::compresspath(wchar_t *path)
Parameters:
| wchar_t * | path | [IN/OUT] | The path (as null-terminated string). |
Return value:Returns a pointer to the compressed path.
Remarks:
The provided path will be overwritten with the simplified path. (The length of the simplified path is always shorter or equal to the length of the provided path.)
compresspath (version 2)
Simplifies a path by removing
./ and
../ from the path where possible. (One or more
../ directories at the beginning of the path are not removed.)
This is not jet correctly implemented!
Signature:
wchar_t *path::compresspath(wchar_t *path,const wchar_t *dirsep)
Parameters:
| wchar_t * | path | [IN/OUT] | The path (as null-terminated string). |
| const wchar_t * | dirsep | [IN] | The symbols used to separate directory names. |
Return value:Returns a pointer to the compressed path.
Remarks:
The provided path will be overwritten with the simplified path. (The length of the simplified path is always shorter or equal to the length of the provided path.)