libxcks
0.1.0.1
|
Generates new instances of the subclasses of the Checksum
class that the application knows.
More...
#include <ckfactory.hpp>
Classes | |
class | ChecksumEntry |
Represents an entry of the checksum or hash algorithms that the application knows. More... | |
Public Member Functions | |
ChecksumFactory (const ChecksumFactory &)=delete | |
Deleted copy constructor. More... | |
ChecksumFactory & | operator= (const ChecksumFactory &)=delete |
Deleted assignment operator. More... | |
Static Public Member Functions | |
static void | initialise () |
Initializes the static members of the class. More... | |
static void | cleanUp () |
Cleans-up the static members of the class. More... | |
static Checksum * | getNewInstance (const ChecksumAlgoId id) |
Gives a pointer on a new instance of the specified checksum or hash identifier. More... | |
static Checksum * | getNewInstance (const std::string &name, const bool lookInAltNames=true) |
Gives a pointer on a new instance of the specified checksum or hash name. More... | |
static ChecksumValue | getNullValue (const ChecksumAlgoId id) |
Gives null value of the specified checksum or hash identifier. More... | |
static ChecksumValue | getNullValue (const std::string &name, const bool lookInAltNames=true) |
Gives null value of the specified checksum or hash name. More... | |
static size_t | getSize (const ChecksumAlgoId id) |
Gets the size in bytes of the specified checksum or hash identifier. More... | |
static size_t | getSize (const std::string &name, const bool lookInAltNames=true) |
Gets the size in bytes of the specified checksum or hash name. More... | |
static bool | exists (const ChecksumAlgoId id) |
Returns true if the given identifier of the checksum or hash algorithm exists. More... | |
static bool | exists (const std::string &name, const bool lookInAltNames=true) |
Returns true if the given name of the checksum or hash algorithm exists. More... | |
static bool | existsNoCase (const std::string &name, const bool lookInAltNames=true) |
Returns true if the given name of the checksum or hash algorithm exists with no case comparison. More... | |
static ArrayChecksumAlgoId | getAlgorithmsIds () |
Returns all the identifiers of the available checksum or hash algorithms. More... | |
static ArrayString | getAlgorithmsNames () |
Returns all the names of the available checksum or hash algorithms. More... | |
static int | getAlgorithmsCount () |
Returns the number of available checksum or hash algorithms. More... | |
static bool | getAlgorithmId (ChecksumAlgoId &id, const std::string &name, const bool lookInAltNames=true) |
Gets the identifier of a checksum or hash algorithm from its name. More... | |
static bool | getAlgorithmIdNoCase (ChecksumAlgoId &id, const std::string &name, const bool lookInAltNames=true) |
Gets the identifier of a checksum or hash algorithm from its name with no case comparison. More... | |
static bool | getAlgorithmName (std::string &name, const ChecksumAlgoId id) |
Gets the name of a checksum or hash algorithm from its identifier. More... | |
static bool | getAlgorithmName (std::string &name, const std::string &altName) |
Gets the name of a checksum or hash algorithm from one of its alternatives names. More... | |
static bool | getAlgorithmAltNames (ArrayString &altNames, const ChecksumAlgoId id, const bool giveName=false) |
Gets the alternatives names of a checksum or hash algorithm from its identifier. More... | |
static bool | getAlgorithmAltNames (ArrayString &altNames, const std::string &name, const bool nameCouldBeAlt=true, const bool giveName=false) |
Gets the alternatives names of a checksum or hash algorithm from its name or one of its alternative names. More... | |
static std::string | getAlgorithmDescription (const ChecksumAlgoId id) |
Returns the description of a checksum or hash algorithm from its identifier. More... | |
static std::string | getAlgorithmDescription (const std::string &name, const bool lookInAltNames=true) |
Returns the description of a checksum or hash algorithm from its name. More... | |
Generates new instances of the subclasses of the Checksum
class that the application knows.
Known checksums and hashs classes are registered in the initialise()
static member. Call it at the start of the program if LibXCKSInitialiser
is not used.
Definition at line 46 of file ckfactory.hpp.
|
delete |
Deleted copy constructor.
|
static |
Cleans-up the static members of the class.
Definition at line 263 of file ckfactory.cpp.
|
static |
Returns true
if the given identifier of the checksum or hash algorithm exists.
id | Identifier of the checksum or hash algorithm of which the caller wants to check its existence. |
true
if the given identifier of the checksum or hash algorithm exists, false
otherwise. Definition at line 409 of file ckfactory.cpp.
|
static |
Returns true
if the given name of the checksum or hash algorithm exists.
name | Name of the checksum or hash algorithm of which the caller wants to check its existence. |
lookInAltNames | Looks for the name of the checksum or hash algorithm in the alternative names. |
true
if the given name of the checksum or hash algorithm exists, false
otherwise. Definition at line 430 of file ckfactory.cpp.
|
static |
Returns true
if the given name of the checksum or hash algorithm exists with no case comparison.
name | Name of the checksum or hash algorithm of which the caller wants to check its existence. |
lookInAltNames | Looks for the name of the checksum or hash algorithm in the alternative names. |
true
if the given name of the checksum or hash algorithm exists, false
otherwise. Definition at line 449 of file ckfactory.cpp.
|
static |
Gets the alternatives names of a checksum or hash algorithm from its identifier.
altNames
array isn't cleared before adding names into. It's the responsibility of the caller to do this.[out] | altNames | Alternate names of the checksum or hash algorithm. |
id | Identifier of the checksum or hash algorithm of which the caller wants the alternative names. | |
giveName | If true gives also the name of the checksum or hash algorithm. |
true
if a checksum or hash algorithm with the given identifier has been found, false
otherwise. Definition at line 667 of file ckfactory.cpp.
|
static |
Gets the alternatives names of a checksum or hash algorithm from its name or one of its alternative names.
altNames
array isn't cleared before adding names into. It's the responsibility of the caller to do this.[out] | altNames | Alternate names of the checksum or hash algorithm. |
name | Name (or one of the alternative names if nameCouldBeAlt is true ) of the checksum or hash algorithm of which the caller wants the alternative names. | |
nameCouldBeAlt | If true looks also in the alternative names list to find the checksum or hash algorithm. | |
giveName | If true gives also the name of the checksum or hash algorithm. |
true
if a checksum or hash algorithm with the given identifier has been found, false
otherwise. Definition at line 703 of file ckfactory.cpp.
|
static |
Returns the description of a checksum or hash algorithm from its identifier.
id | Identifier of the checksum or hash algorithm of which the caller wants the description. |
Definition at line 726 of file ckfactory.cpp.
|
static |
Returns the description of a checksum or hash algorithm from its name.
name | Name of the checksum or hash algorithm of which the caller wants the description. |
lookInAltNames | Looks for the name of the checksum or hash algorithm in the alternative names. |
Definition at line 747 of file ckfactory.cpp.
|
static |
Gets the identifier of a checksum or hash algorithm from its name.
[out] | id | Identifier of the checksum or hash algorithm. |
name | Name of the checksum or hash algorithm of which the caller wants the identifier. | |
lookInAltNames | Looks for the name of the checksum or hash algorithm in the alternative names. |
true
if a checksum or hash algorithm with the given name has been found, false
otherwise. Definition at line 518 of file ckfactory.cpp.
|
static |
Gets the identifier of a checksum or hash algorithm from its name with no case comparison.
[out] | id | Identifier of the checksum or hash algorithm. |
name | Name of the checksum or hash algorithm of which the caller wants the identifier. | |
lookInAltNames | Looks for the name of the checksum or hash algorithm in the alternative names. |
true
if a checksum or hash algorithm with the given name has been found, false
otherwise. Definition at line 569 of file ckfactory.cpp.
|
static |
Gets the name of a checksum or hash algorithm from its identifier.
[out] | name | Name of the checksum or hash algorithm. |
id | Identifier of the checksum or hash algorithm of which the caller wants the name. |
true
if a checksum or hash algorithm with the given identifier has been found, false
otherwise. Definition at line 617 of file ckfactory.cpp.
|
static |
Gets the name of a checksum or hash algorithm from one of its alternatives names.
[out] | name | Name of the checksum or hash algorithm. |
altName | Alternative name (or name but it's stupid) of the checksum or hash algorithm of which the caller wants the name. |
true
if a checksum or hash algorithm with the given alternative name (or name) has been found, false
otherwise. Definition at line 641 of file ckfactory.cpp.
|
static |
Returns the number of available checksum or hash algorithms.
Definition at line 500 of file ckfactory.cpp.
|
static |
Returns all the identifiers of the available checksum or hash algorithms.
Definition at line 462 of file ckfactory.cpp.
|
static |
Returns all the names of the available checksum or hash algorithms.
Definition at line 481 of file ckfactory.cpp.
|
static |
Gives a pointer on a new instance of the specified checksum or hash identifier.
The caller is responsible of the deletion of the instance with the delete
operator.
id | Identifier of the checksum or hash algorithm of which the caller wants a new instance. |
nullptr
if the specified identifier is invalid. Definition at line 282 of file ckfactory.cpp.
|
static |
Gives a pointer on a new instance of the specified checksum or hash name.
The caller is responsible of the deletion of the instance with the delete
operator.
name | Name of the checksum or hash algorithm of which the caller wants a new instance. |
lookInAltNames | Looks for the name of the checksum or hash algorithm in the alternative names. |
nullptr
if the specified identifier is invalid. Definition at line 306 of file ckfactory.cpp.
|
static |
Gives null value of the specified checksum or hash identifier.
id | Identifier of the checksum or hash algorithm of which the caller wants a null value. |
ChecksumAlgoId::Invalid
if the specified identifier is invalid. Definition at line 327 of file ckfactory.cpp.
|
static |
Gives null value of the specified checksum or hash name.
name | Name of the checksum or hash algorithm of which the caller wants a null value. |
lookInAltNames | Looks for the name of the checksum or hash algorithm in the alternative names. |
ChecksumAlgoId::Invalid
if the specified name is invalid. Definition at line 348 of file ckfactory.cpp.
|
static |
Gets the size in bytes of the specified checksum or hash identifier.
id | Identifier of the checksum or hash algorithm of which the caller wants the size in bytes. |
SIZE_MAX
if the specified identifier is invalid. Definition at line 368 of file ckfactory.cpp.
|
static |
Gets the size in bytes of the specified checksum or hash name.
name | Name of the checksum or hash algorithm of which the caller wants the size in bytes. |
lookInAltNames | Looks for the name of the checksum or hash algorithm in the alternative names. |
SIZE_MAX
if the specified name is invalid. Definition at line 388 of file ckfactory.cpp.
|
static |
Initializes the static members of the class.
The name the type of the checksums' file should be the same as the one returned by checksums_file_type::getFileType()
.
Definition at line 183 of file ckfactory.cpp.
|
delete |
Deleted assignment operator.