This documenta- tion describes the current state of development.
Note that interfaces and functionality may still change.

Prokee Modules:
  A
  B
  C
  D
  E
  F
  G
  I
  L
  M
  N
  O
  P
  R
  S
  T
  U
  W

     open all    |    close all

GUI Elements:
  B
  C
  I
  M
  P
  R
  S
  T

     open all    |    close all

GUI Interactions:
  B
  F
  H
  S

     open all    |    close all

GUI Layouts:
  L

     open all    |    close all

Games/Demos:
  M

     open all    |    close all

Third Party Libraries:
  P
  F
  Z

     open all    |    close all

Information about this Website / Informationen zu dieser Webseite:
In case of any questions, or comments, please feel free to contact me via email at apoll500@gmail.com.

Module path [Version: v01]

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)
getProkeeInstallDirectory
char *path::getProkeeInstallDirectory(unsigned int extra_length)
getProkeeWorkingDirectory
char *path::getProkeeWorkingDirectory(unsigned int extra_length)

Static Template Methods:
pathtype
pathtype (version 1)
int path::pathtype(const wchar_t *path)
pathtype (version 2)
int path::pathtype(const wchar_t *path,int system)
pathtype (version 3)
int path::pathtype(const wchar_t *path,wchar_t dirsep)
pathtype (version 4)
int path::pathtype(const wchar_t *path,wchar_t dirsep,wchar_t labelsep)
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
onopath (version 1)
const wchar_t *path::onopath(const wchar_t *path)
onopath (version 2)
const wchar_t *path::onopath(const wchar_t *path,wchar_t dirsep)
onopath (version 3)
const wchar_t *path::onopath(const wchar_t *path,const wchar_t *dirsep)
fnopath
fnopath (version 1)
const wchar_t *path::fnopath(const wchar_t *path)
fnopath (version 2)
const wchar_t *path::fnopath(const wchar_t *path,wchar_t dirsep)
fnopath (version 3)
const wchar_t *path::fnopath(const wchar_t *path,const wchar_t *dirsep)
dnopath
dnopath (version 1)
wchar_t *path::dnopath(const wchar_t *path)
dnopath (version 2)
wchar_t *path::dnopath(const wchar_t *path,wchar_t dirsep)
dnopath (version 3)
wchar_t *path::dnopath(const wchar_t *path,const wchar_t *dirsep)
pnopath
pnopath (version 1)
wchar_t *path::pnopath(const wchar_t *path)
pnopath (version 2)
wchar_t *path::pnopath(const wchar_t *path,wchar_t dirsep)
pnopath (version 3)
wchar_t *path::pnopath(const wchar_t *path,const wchar_t *dirsep)
sxopath
sxopath (version 1)
const wchar_t *path::sxopath(const wchar_t *path)
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
makeabspath (version 1)
wchar_t *path::makeabspath(const wchar_t *path)
makeabspath (version 2)
wchar_t *path::makeabspath(const wchar_t *path,const wchar_t *cd)
makeabspath (version 3)
wchar_t *path::makeabspath(const wchar_t *path,const wchar_t *cd,const wchar_t *dirsep)
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
pathcmp (version 1)
bool path::pathcmp(const wchar_t *path_a,const wchar_t *path_b)
compresspath
compresspath (version 1)
wchar_t *path::compresspath(wchar_t *path)
compresspath (version 2)
wchar_t *path::compresspath(wchar_t *path,const wchar_t *dirsep)

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:
Type Name Direction Description
int argcThe 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:
Type Name Direction Description
unsigned int extra_length

   getProkeeWorkingDirectory


Returns the absolute path to the prokee working directory.

Signature:
char *path::getProkeeWorkingDirectory(unsigned int extra_length)

Parameters:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
const wchar_t *path[IN]The path (as null-terminated string).
int systemSpecifies 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:
Type Name Direction Description
const wchar_t *path[IN]The path (as null-terminated string).
wchar_t dirsepThe 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:
Type Name Direction Description
const wchar_t *path[IN]The path (as null-terminated string).
wchar_t dirsepThe symbol used to separate directory names.
wchar_t labelsepThe 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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
const wchar_t *path[IN]The path (as null-terminated string).
wchar_t dirsepThe 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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
const wchar_t *path[IN]The path (as null-terminated string).
wchar_t dirsepThe 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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
const wchar_t *path[IN]The path (as null-terminated string).
wchar_t dirsepThe 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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
const wchar_t *path[IN]The path (as null-terminated string).
wchar_t dirsepThe 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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
const wchar_t *path[IN]The path (as null-terminated string).
wchar_t dirsepThe symbol used to separate directory names.
wchar_t labelsepThe symbol used to mark the end of the label.
wchar_t susepThe 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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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.)


Copyright © 2017 - 2019 by Andreas Pollhammer