CONZEPT 16 C++ API
|
Binary directory buffer to operate on binary directories. More...
#include "C16/Binary.hpp"
Binary directory buffer to operate on binary directories.
Public Member Functions | |
BinaryDirectory () | |
Constructs a binary directory buffer. More... | |
Result | read (const BinaryDirectory &directory, const std::string &name, Place place=Place::KEY, Locking locking=Locking::NONE) override |
Reads a binary by means of a base binary directory, a reference name and a place into the binary buffer. More... | |
Result | read (const BinaryDirectory &directory, Place place, Locking locking=Locking::NONE) override |
Reads a binary by means of a base binary directory and a place into the binary buffer. More... | |
Result | read (const BinaryDirectory &directory, const std::string &path, Locking locking=Locking::LOCK_SHARED) override |
Reads a binary by means of a base binary directory and a path into the binary buffer. More... | |
void | unload () override |
Unloads the loaded binary. More... | |
Result | write () const override |
Writes the loaded binary. More... | |
Result | create (const BinaryDirectory &directory, const std::string &path, Locking locking=Locking::LOCK_SHARED, bool overwrite=false) override |
Creates and loads a binary. More... | |
Result | erase_directory (const std::string &path) const |
Deletes a binary directory within the loaded binary directory. More... | |
Result | erase_object (const std::string &path) const |
Deletes a binary object within the loaded binary directory. More... | |
Result | clear_object (const std::string &path) const |
Clears a binary object within the loaded binary directory. More... | |
![]() | |
const Database * | database () const |
Gets the database of the loaded binary. More... | |
Database * | database () |
Gets the database of the loaded binary. More... | |
bool | loaded () const |
Gets if a binary is loaded into the binary buffer. More... | |
bool | locked () const |
Gets if the loaded binary is locked by the user accessing the database. More... | |
long long int | id () const |
Gets the id of the loaded binary. More... | |
const std::string & | name () const |
Gets the name of the loaded binary. More... | |
const std::string & | path () const |
Gets the path of the loaded binary. More... | |
const std::string & | custom () const |
Gets the custom property of the loaded binary. More... | |
virtual void | custom_set (const std::string &custom) |
Sets the custom property of the loaded binary. More... | |
virtual Result | rename (const std::string &name) |
Renames the loaded binary. More... | |
virtual Result | move_to (const BinaryDirectory &directory) |
Moves the loaded binary to another directory. More... | |
Additional Inherited Members | |
![]() | |
enum | Error { Error::CONTENT_EMPTY = 1, Error::CIPHER_KEY_INCORRECT, Error::OPERATION_UNAVAILABLE } |
Error of an operation on a binary. More... | |
![]() | |
static const int | NAME_LENGTH_LIMIT = 60 |
Name length limit. More... | |
static const int | CUSTOM_LENGTH_LIMIT = 255 |
Custom property length limit. More... | |
C16::BinaryDirectory::BinaryDirectory | ( | ) |
Constructs a binary directory buffer.
|
overridevirtual |
Reads a binary by means of a base binary directory, a reference name and a place into the binary buffer.
directory | Base binary directory buffer | ||||||||
name | Reference name (case insensitive, 0 to NAME_LENGTH_LIMIT characters) | ||||||||
place | Place of the binary
| ||||||||
locking | Locking to apply to the binary
|
Result::OK | Binary loaded and locking applied. |
Result::LOCKED | Binary already locked. No binary loaded. |
Result::NO_REC | Binary inexistent or base binary directory buffer not loaded. |
Result::NO_LOCK | Base binary directory not locked. |
Exception::Invalidity | Name invalid. |
Exception::Invalidity | Place invalid. |
Exception::Invalidity | Locking invalid. |
Exception | Operation unavailable. This is a root directory. |
Implements C16::Binary.
|
overridevirtual |
Reads a binary by means of a base binary directory and a place into the binary buffer.
directory | Base binary directory buffer | ||||||||
place | Place of the binary
| ||||||||
locking | Lock to apply to the binary
|
Result::OK | Binary loaded and locking applied. |
Result::LOCKED | Binary already locked. No binary loaded. |
Result::NO_REC | Binary inexistent or base binary directory buffer not loaded. |
Result::NO_LOCK | Base binary directory not locked. |
Exception::Invalidity | Place invalid. |
Exception::Invalidity | Locking invalid. |
Exception | Operation unavailable. This is a root directory. |
Implements C16::Binary.
|
overridevirtual |
Reads a binary by means of a base binary directory and a path into the binary buffer.
directory | Base binary directory buffer | ||||||
path | Path to the binary relative to the base binary directory | ||||||
locking | Locking to apply to the binary
|
Result::OK | Binary loaded and locking applied. |
Result::NO_KEY | Binary inexistent but following binary existent and loaded. |
Result::LAST_REC | Binary and following binary inexistent but preceding binary existent and loaded. |
Result::NO_REC | Binary inexistent or base binary directory buffer not loaded. |
Result::NO_LOCK | Base binary directory not locked. |
Result::DEADLOCK | Deadlock occurred. |
Exception::Invalidity | Name invalid. |
Exception::Invalidity | Locking invalid. |
Exception | Operation unavailable. This is a root directory. |
Implements C16::Binary.
|
overridevirtual |
Unloads the loaded binary.
Exception | Operation unavailable. This is a root directory. |
Implements C16::Binary.
|
overridevirtual |
Writes the loaded binary.
Result::OK | Binary written. |
Result::NO_REC | No binary loaded. |
Result::NO_LOCK | Binary not exclusively locked. |
Result::DEADLOCK | Deadlock occurred. |
Exception | Operation unavailable. This is a root directory. |
Implements C16::Binary.
|
overridevirtual |
Creates and loads a binary.
directory | Base binary directory buffer | ||||||
path | Path to the binary relative to the base binary directory | ||||||
locking | Locking to apply to the binary
| ||||||
overwrite | Option to overwrite a binary with the same name (case insensitive) |
Result::OK | Binary created, loaded and locking applied. |
Result::NO_REC | No binary loaded. |
Result::EXISTS | Binary with same name (case insensitive) already existent. |
Result::NO_LOCK | Binary not exclusively locked or base binary directory not locked. |
Result::DEADLOCK | Deadlock occurred. |
Exception::Invalidity | Name invalid. |
Exception | Operation unavailable. Possible reasons:
|
Implements C16::Binary.
Result C16::BinaryDirectory::erase_directory | ( | const std::string & | path | ) | const |
Deletes a binary directory within the loaded binary directory.
path | Path relative to the binary directory |
Result::OK | Binary directory deleted. |
Result::LOCKED | Binary directory locked. |
Result::NO_REC | No binary directory loaded or binary directory inexistent. |
Result::DEADLOCK | Deadlock occurred. |
Exception::Invalidity | Name invalid. |
Result C16::BinaryDirectory::erase_object | ( | const std::string & | path | ) | const |
Deletes a binary object within the loaded binary directory.
path | Path relative to the binary directory |
Result::OK | Binary object deleted. |
Result::LOCKED | Binary object locked. |
Result::NO_REC | No binary object loaded or binary object inexistent. |
Result::DEADLOCK | Deadlock occurred. |
Exception::Invalidity | Name invalid. |
Result C16::BinaryDirectory::clear_object | ( | const std::string & | path | ) | const |
Clears a binary object within the loaded binary directory.
path | Path relative to the binary directory |
Result::OK | Binary object deleted. |
Result::LOCKED | Binary object locked. |
Result::NO_REC | No binary object loaded or binary object inexistent. |
Result::DEADLOCK | Deadlock occurred. |
Exception::Invalidity | Name invalid. |