Forward to C-runtime library functions. More...
Typedefs | |
using | Murl::System::CLib::CompareFunctionType = SInt32(*)(const void *source1, const void *source2) |
Definition of the compare function. More... | |
Functions | |
String | Murl::System::CLib::PrintToString (const Char *format,...) |
Print formatted variadic arguments into string. More... | |
String | Murl::System::CLib::PrintToStringArg (const Char *format, void *vaListPtr) |
Print formatted variadic arguments into string. More... | |
SInt32 | Murl::System::CLib::PrintToDebug (const Char *format,...) |
Print formatted variadic arguments to the system specific debug output. More... | |
SInt32 | Murl::System::CLib::PrintToError (const Char *format,...) |
Print formatted variadic arguments to the system specific error output. More... | |
SInt32 | Murl::System::CLib::PrintToWarning (const Char *format,...) |
Print formatted variadic arguments to the system specific warning output. More... | |
SInt32 | Murl::System::CLib::PrintToCString (Char *targetString, UInt32 targetLength, const Char *format,...) |
Print formatted variadic arguments into a C-string. More... | |
SInt32 | Murl::System::CLib::PrintToFile (const Char *fileName, const Char *format,...) |
Print formatted variadic arguments to file. More... | |
SInt32 | Murl::System::CLib::PrintToStdOut (const Char *format,...) |
Print formatted variadic arguments to stdout. More... | |
SInt32 | Murl::System::CLib::ScanString (const Char *stringToScan, const Char *format,...) |
Scan formatted string into variadic arguments. More... | |
void * | Murl::System::CLib::Alloc (UInt64 byteSize) |
Allocate heap memory. More... | |
void | Murl::System::CLib::Free (void *data) |
Free allocated heap memory. More... | |
void * | Murl::System::CLib::MemSet (void *destination, UInt32 value, UInt64 byteSize) |
Fill memory with a value. More... | |
void * | Murl::System::CLib::MemCopy (void *destination, const void *source, UInt64 byteSize) |
Copy non-overlapping memory. More... | |
void * | Murl::System::CLib::MemMove (void *destination, const void *source, UInt64 byteSize) |
Copy overlapping memory. More... | |
SInt32 | Murl::System::CLib::MemCompare (const void *source1, const void *source2, UInt64 byteSize) |
Compare memory. More... | |
void | Murl::System::CLib::QuickSort (void *items, UInt32 numberOfItems, UInt32 itemByteSize, CompareFunctionType compareFunction) |
Quick sort items. More... | |
void * | Murl::System::CLib::BinarySearch (const void *key, const void *items, UInt32 numberOfItems, UInt32 itemByteSize, CompareFunctionType compareFunction) |
Binary search an item. More... | |
void | Murl::System::CLib::SRand (UInt32 seed) |
Seed the C-runtime library random number generator. More... | |
SInt32 | Murl::System::CLib::Rand () |
Get a random number form the C-runtime library random number generator. More... | |
SInt32 | Murl::System::CLib::StrCmp (const Char *string1, const Char *string2) |
Compare C-strings. More... | |
UInt32 | Murl::System::CLib::StrLen (const Char *string) |
Get the length of C-string. More... | |
Bool | Murl::System::CLib::IsDigit (SInt32 characterCode) |
Check if a character is a numeric character. More... | |
Bool | Murl::System::CLib::IsAlpha (SInt32 characterCode) |
Check if a character is an alphabetic character. More... | |
Bool | Murl::System::CLib::IsAlphaNumeric (SInt32 characterCode) |
Check if a character is an alphanumeric character. More... | |
Bool | Murl::System::CLib::IsPunctuation (SInt32 characterCode) |
Check if a character is a punctuation character. More... | |
Bool | Murl::System::CLib::IsSpace (SInt32 characterCode) |
Check if a character is a spacing character. More... | |
Bool | Murl::System::CLib::IsHexDigit (SInt32 characterCode) |
Check if a character is a hexadecimal character. More... | |
Bool | Murl::System::CLib::IsControl (SInt32 characterCode) |
Check if a character is a control character. More... | |
String | Murl::System::CLib::GetNormalizedFileSystemPath (const Char *nativePath) |
Get a normalized (UTF8) representation of a native file system path. More... | |
String | Murl::System::CLib::GetNativeFileSystemPath (const Char *normalizedPath) |
Get a native representation of a normalized (UTF8) file system path. More... | |
Bool | Murl::System::CLib::FileExists (const Char *path) |
Check if a file exists. More... | |
Bool | Murl::System::CLib::DeleteFile (const Char *path) |
Delete a file. More... | |
Bool | Murl::System::CLib::MoveFile (const Char *oldPath, const Char *newPath) |
Move/rename a file. More... | |
Bool | Murl::System::CLib::FolderExists (const Char *path) |
Check if a folder exists. More... | |
Bool | Murl::System::CLib::CreateFolder (const Char *path) |
Create a folder. More... | |
Bool | Murl::System::CLib::DeleteFolder (const Char *path, Bool recursively) |
Delete a folder. More... | |
Bool | Murl::System::CLib::MoveFolder (const Char *oldPath, const Char *newPath) |
Move/rename a folder. More... | |
Bool | Murl::System::CLib::GetItemCreationTime (const Char *path, UInt64 &seconds, UInt64 &nanoSeconds) |
Get the creation time of a file or folder. More... | |
Bool | Murl::System::CLib::GetItemModificationTime (const Char *path, UInt64 &seconds, UInt64 &nanoSeconds) |
Get the time a file or folder was most recently modified. More... | |
SInt32 | Murl::System::CLib::LaunchShellCommand (const Char *commandLine) |
Launch a shell command if supported by the platform. More... | |
void | Murl::System::CLib::Abort () |
Call the C-runtime abort function. | |
void | Murl::System::CLib::Exit (SInt32 exitCode) |
Call the C-runtime exit function. More... | |
Detailed Description
Forward to C-runtime library functions.
Typedef Documentation
◆ CompareFunctionType
using Murl::System::CLib::CompareFunctionType = typedef SInt32(*)(const void* source1, const void* source2) |
Definition of the compare function.
- Parameters
-
source1 Pointer to the 1st source. source2 Pointer to the 2nd source.
- Returns
- Zero if source1 is equal to source2, negativ if source1 is lesser than source2, positive if source1 is greater than source2.
Function Documentation
◆ PrintToString()
Print formatted variadic arguments into string.
- Parameters
-
format The format string. ... The variadic arguments.
- Returns
- The string with the printed arguments.
◆ PrintToStringArg()
Print formatted variadic arguments into string.
- Parameters
-
format The format string. vaListPtr Pointer to the variadic arguments.
- Returns
- The string with the printed arguments.
◆ PrintToDebug()
Print formatted variadic arguments to the system specific debug output.
- Parameters
-
format The format string. ... The variadic arguments.
- Returns
- The number of characters printed excluding the null terminator.
◆ PrintToError()
Print formatted variadic arguments to the system specific error output.
- Parameters
-
format The format string. ... The variadic arguments.
- Returns
- The number of characters printed excluding the null terminator.
◆ PrintToWarning()
Print formatted variadic arguments to the system specific warning output.
- Parameters
-
format The format string. ... The variadic arguments.
- Returns
- The number of characters printed excluding the null terminator.
◆ PrintToCString()
SInt32 Murl::System::CLib::PrintToCString | ( | Char * | targetString, |
UInt32 | targetLength, | ||
const Char * | format, | ||
... | |||
) |
Print formatted variadic arguments into a C-string.
- Parameters
-
targetString The C-string to print into. targetLength The byte length of the C-string to print into. format The format string. ... The variadic arguments.
- Returns
- The number of characters printed excluding the null terminator.
◆ PrintToFile()
Print formatted variadic arguments to file.
The printed string is appended to the file.
- Parameters
-
fileName The file name to print into. format The format string. ... The variadic arguments.
- Returns
- The number of characters printed excluding the null terminator.
◆ PrintToStdOut()
Print formatted variadic arguments to stdout.
- Parameters
-
format The format string. ... The variadic arguments.
- Returns
- The number of characters printed excluding the null terminator.
◆ ScanString()
Scan formatted string into variadic arguments.
- Parameters
-
stringToScan The string to scan. format The format string. ... The variadic arguments.
- Returns
- The number of items assigned.
◆ Alloc()
void* Murl::System::CLib::Alloc | ( | UInt64 | byteSize | ) |
Allocate heap memory.
- Parameters
-
byteSize The number of bytes to allocate.
- Returns
- The pointer to the allocated memory.
◆ Free()
void Murl::System::CLib::Free | ( | void * | data | ) |
Free allocated heap memory.
- Parameters
-
data The pointer to the allocated memory.
◆ MemSet()
Fill memory with a value.
- Parameters
-
destination Pointer to the destination memory. value The byte-value to fill the memory. byteSize The number of bytes to fill.
- Returns
- The pointer to the destination memory.
Referenced by Murl::Util::MemClear(), and Murl::Util::MemSet().
◆ MemCopy()
void* Murl::System::CLib::MemCopy | ( | void * | destination, |
const void * | source, | ||
UInt64 | byteSize | ||
) |
Copy non-overlapping memory.
Use MemMove if the memory areas do overlap.
- Parameters
-
destination Pointer to the destination memory. source Pointer to the source memory. byteSize The number of bytes to copy.
- Returns
- The pointer to the destination memory.
Referenced by Murl::Util::MemCopy(), and Murl::Util::MemCopyArray().
◆ MemMove()
void* Murl::System::CLib::MemMove | ( | void * | destination, |
const void * | source, | ||
UInt64 | byteSize | ||
) |
Copy overlapping memory.
- Parameters
-
destination Pointer to the destination memory. source Pointer to the source memory. byteSize The number of bytes to copy.
- Returns
- The pointer to the destination memory.
Referenced by Murl::Util::MemMove().
◆ MemCompare()
SInt32 Murl::System::CLib::MemCompare | ( | const void * | source1, |
const void * | source2, | ||
UInt64 | byteSize | ||
) |
Compare memory.
- Parameters
-
source1 Pointer to the 1st source memory. source2 Pointer to the 2nd source memory. byteSize The number of bytes to compare.
- Returns
- Zero if source1 is equal to source2, negativ if source1 is lesser than source2, positive if source1 is greater than source2.
Referenced by Murl::String::EndsWith(), Murl::Util::MemCompare(), and Murl::String::StartsWith().
◆ QuickSort()
void Murl::System::CLib::QuickSort | ( | void * | items, |
UInt32 | numberOfItems, | ||
UInt32 | itemByteSize, | ||
CompareFunctionType | compareFunction | ||
) |
Quick sort items.
- Parameters
-
items Pointer to the items to sort. numberOfItems Number of items to sort. itemByteSize Bytesize of an item. compareFunction The CompareFunctionType for the item.
Referenced by Murl::Util::QuickSort().
◆ BinarySearch()
void* Murl::System::CLib::BinarySearch | ( | const void * | key, |
const void * | items, | ||
UInt32 | numberOfItems, | ||
UInt32 | itemByteSize, | ||
CompareFunctionType | compareFunction | ||
) |
Binary search an item.
The items to search for are required to be sorted.
- Parameters
-
key Pointer to the item to find. items Pointer to the items to search for. numberOfItems Number of items to search for. itemByteSize Bytesize of an item. compareFunction The CompareFunctionType for the item.
- Returns
- Pointer to the item found or null if item is not found. If there are multiple elements matching key, the element returned is unspecified.
Referenced by Murl::Util::BinarySearch().
◆ SRand()
void Murl::System::CLib::SRand | ( | UInt32 | seed | ) |
Seed the C-runtime library random number generator.
- Parameters
-
seed The seed for the random number generator.
◆ Rand()
SInt32 Murl::System::CLib::Rand | ( | ) |
Get a random number form the C-runtime library random number generator.
- Returns
- The random number.
◆ StrCmp()
Compare C-strings.
- Parameters
-
string1 Pointer to the 1st C-string. string2 Pointer to the 2nd C-string.
- Returns
- Zero if string1 is equal to string2, negativ if string1 is lesser than string2, positive if string1 is greater than string2.
◆ StrLen()
Get the length of C-string.
- Parameters
-
string Pointer to the C-string.
- Returns
- The length of the C-string.
◆ IsDigit()
Check if a character is a numeric character.
- Parameters
-
characterCode The character to check.
- Returns
- true if the character is a numeric character.
◆ IsAlpha()
Check if a character is an alphabetic character.
- Parameters
-
characterCode The character to check.
- Returns
- true if the character is an alphabetic character.
◆ IsAlphaNumeric()
Check if a character is an alphanumeric character.
- Parameters
-
characterCode The character to check.
- Returns
- true if the character is an alphanumeric character.
◆ IsPunctuation()
Check if a character is a punctuation character.
- Parameters
-
characterCode The character to check.
- Returns
- true if the character is a punctuation character.
◆ IsSpace()
Check if a character is a spacing character.
- Parameters
-
characterCode The character to check.
- Returns
- true if the character is a spacing character.
◆ IsHexDigit()
Check if a character is a hexadecimal character.
- Parameters
-
characterCode The character to check.
- Returns
- true if the character is a hexadecimal character.
◆ IsControl()
Check if a character is a control character.
- Parameters
-
characterCode The character to check.
- Returns
- true if the character is a control character.
◆ GetNormalizedFileSystemPath()
Get a normalized (UTF8) representation of a native file system path.
- Parameters
-
nativePath The file system path in its native representation.
- Returns
- true The normalized path.
◆ GetNativeFileSystemPath()
Get a native representation of a normalized (UTF8) file system path.
- Parameters
-
normalizedPath The file system path in its normalized representation.
- Returns
- true The native path.
◆ FileExists()
Check if a file exists.
- Parameters
-
path The path and the filename.
- Returns
- true if the file exists.
◆ DeleteFile()
Delete a file.
- Parameters
-
path The path to the file to delete.
- Returns
- true if successful.
◆ MoveFile()
Move/rename a file.
- Parameters
-
oldPath The current path to the file to move. newPath The new path of the file.
- Returns
- true if successful.
◆ FolderExists()
Check if a folder exists.
- Parameters
-
path The path and the folder.
- Returns
- true if the folder exists.
◆ CreateFolder()
Create a folder.
- Parameters
-
path The path and the folder to create.
- Returns
- true if successful.
◆ DeleteFolder()
Delete a folder.
- Parameters
-
path The path and the folder to delete. recursively If true, the folder and all contents are deleted. If false, the function fails when the folder is not empty.
- Returns
- true if successful.
◆ MoveFolder()
Move/rename a folder.
- Parameters
-
oldPath The current path to the folder to move. newPath The new path of the folder.
- Returns
- true if successful.
◆ GetItemCreationTime()
Bool Murl::System::CLib::GetItemCreationTime | ( | const Char * | path, |
UInt64 & | seconds, | ||
UInt64 & | nanoSeconds | ||
) |
Get the creation time of a file or folder.
Note: explicit item creation time is not available on all platforms, e.g. Android, Linux or emscripten. In this case, false is returned.
- Parameters
-
path The path to the file or folder to query. seconds A reference to an UInt64 value to receive the seconds part. nanoSeconds A reference to an UInt64 value to receive the nanoseconds part.
- Returns
- true if successful.
◆ GetItemModificationTime()
Bool Murl::System::CLib::GetItemModificationTime | ( | const Char * | path, |
UInt64 & | seconds, | ||
UInt64 & | nanoSeconds | ||
) |
Get the time a file or folder was most recently modified.
- Parameters
-
path The path to the file or folder to query. seconds A reference to an UInt64 value to receive the seconds part. nanoSeconds A reference to an UInt64 value to receive the nanoseconds part.
- Returns
- true if successful.
◆ LaunchShellCommand()
Launch a shell command if supported by the platform.
Internally, this calls the CLib std::system function.
- Parameters
-
commandLine The shell command line, including any parameters.
- Returns
- The shell command's exit status.
◆ Exit()
void Murl::System::CLib::Exit | ( | SInt32 | exitCode | ) |
Call the C-runtime exit function.
On iOS this function does nothing.
- Parameters
-
exitCode The exit code.