libcrn
3.9.5
A document image processing library
|
General purpose IO class. More...
#include <CRNIO.h>
Classes | |
class | Directory |
A handler to the content of a directory. More... | |
Public Types | |
enum | { EXISTS, READ, WRITE, EXECUTE } |
IO modes (use with IO::Access()) More... | |
Static Public Member Functions | |
static void | Debug (const String &msg) |
Prints debug messages. Please use CRNDebug() macro instead. More... | |
static void | Warning (const String &msg) |
Prints warning messages. Please use CRNWarning() macro instead. More... | |
static void | Verbose (const String &msg) |
Prints verbose messages. Please use CRNVerbose() macro instead. More... | |
static void | Error (const String &msg) |
Prints error messages. Please use CRNError() macro instead. More... | |
static std::shared_ptr < Messenger > & | CurrentMessenger () |
Delegate that will print the messages. More... | |
static bool & | IsQuiet () |
If true, Debug, Warning, Verbose and Error don't print anything. More... | |
static bool & | IsVerbose () |
Controls whether CRNVerbose prints something or not. More... | |
static void | Mkdir (const Path &name) |
Creates a directory. More... | |
static void | Rm (const Path &name) |
Removes a file. More... | |
static void | ShieldRm (const Path &name) |
Removes a file and protects it with mutex. More... | |
static void | Rmdir (const Path &name) |
Recursively removes a directory. More... | |
static bool | Access (const Path &name, int mode) |
Checks rights on a file. More... | |
static void | Copy (const Path &src, const Path &dst) |
Copies a file. More... | |
static void | ShieldCopy (const Path &src, const Path &dst) |
Copies a file and protects source and destination with mutex. More... | |
General purpose IO class.
This class contains methods to send messages to the end-user via the console or Gtk objects.
anonymous enum |
IO modes (use with IO::Access())
Enumerator | |
---|---|
EXISTS | |
READ | |
WRITE | |
EXECUTE |
|
static |
Checks rights on a file.
Checks accessibility of a file or directory
[in] | name | the path |
[in] | mode | what to check (IO::EXISTS, IO::READ, IO::WRITE, IO::EXECUTE) |
Copies a file.
Copies a file
ExceptionInvalidArgument | source and destination are equal |
ExceptionIO | cannot open source or destination file |
[in] | src | the source file |
[in] | dst | the destination file |
|
static |
|
static |
Prints debug messages. Please use CRNDebug() macro instead.
Prints a message with a "Debug" flag
[in] | msg | The message to print |
|
static |
Prints error messages. Please use CRNError() macro instead.
Prints a message with a "Error" flag
[in] | msg | The message to print |
|
static |
|
static |
|
static |
Creates a directory.
Creates a directory.
ExceptionIO | cannot create directory |
[in] | name | the name of the directory |
|
static |
Removes a file.
Removes a file
ExceptionIO | cannot remove file |
[in] | name | the name of the file |
|
static |
Recursively removes a directory.
Removes a directory and its content
[in] | name | the name of the directory |
ExceptionIO | cannot remove file or directory |
Copies a file and protects source and destination with mutex.
Copies a file and protects source and destination with mutex
ExceptionInvalidArgument | source and destination are equal |
ExceptionIO | cannot open source or destination file |
[in] | src | the source file |
[in] | dst | the destination file |
|
static |
Removes a file and protects it with mutex.
Removes a file and protects it with mutex
ExceptionIO | cannot remove file |
[in] | name | the name of the file |
|
static |
Prints verbose messages. Please use CRNVerbose() macro instead.
Prints a information message
[in] | msg | The message to print |
|
static |
Prints warning messages. Please use CRNWarning() macro instead.
Prints a message with a "Warning" flag
[in] | msg | The message to print |