System CATDbBinary
Usage: you must use this class as is. You should never derive it.
public class CATDbBinary
Class to use to manipulate Binary type of data.
Role:
A Binary is made of a length followed by an area containing
the data:
LLDDDDDDDDDDDD
<--- LL --->
As it doesn't end with '\0', it must always be used with its length.
To ensure the compatibility with DBMSs, the length is a short.
It is possible to set the maximal length of the Binary. If during
an affectation or a concatenation, one tries to exceed this length, a
truncation will occur.
If no length is given, the Binary will not have any size limit.
Constructor and Destructor Index
- o
CATDbBinary(short)
- Default constructor.
- o
CATDbBinary(void*,short)
- Creation of a Binary using an area having a Binary structure.
- o
CATDbBinary(CATDbBinary&)
- Copy constructor.
- o
CATDbBinary(short&,void*,short)
- Creation of a Binary using length and data.
- o
~CATDbBinary()
- Destructor.
Method Index
- o
Build(short,void*,short)
- Initialisation of a binary.
- o
GetBinaryData()
- To get the contents of the Binary (Only the data).
- o
GetHexaValue()
- Converts the contents of the Binary to a hexadecimal character string.
- o
Reset()
- Resets a binary.
- o
operator const char *()
- Cast to a Binary like area.
- o
operator short()
- Cast to get the actual length of the Binary.
- o
operator!=(CATDbBinary&)
- Inequality operator.
- o
operator<<(CATDbBinary&)
- Concatenation from a Binary operator.
- o
operator+(CATDbBinary&)
- Addition from a Binary operator.
- o
operator=(CATDbBinary&)
- Assignment from a CATDbBinary instance operator.
- o
operator==(CATDbBinary&)
- Equality operator.
Constructor and Destructor
o CATDbBinary
public CATDbBinary( | const | iMaxLength | = 0) |
-
Default constructor.
Creation of an empty Binary.
- Parameters:
-
- iMaxLength
- : maximal length
o CATDbBinary
public CATDbBinary( | const | iAreaToCopy, |
| const | iMaxLength | = 0) |
-
Creation of a Binary using an area having a Binary structure.
(ie: length + data)
The rules explained into the preceeding constructor apply.
- Parameters:
-
- iAreaToCopy
- : The pointer to the length & binary value
- iMaxLength
- : maximal length
o CATDbBinary
public CATDbBinary( | const | iBinaryToCopy) |
-
Copy constructor.
The new Binary has the same length limit as the copied Binary
- Parameters:
-
- iBinaryToCopy
- : The binary to copy
o CATDbBinary
public CATDbBinary( | const | iLengthToCopy, |
| const | iAreaToCopy, |
| const | iMaxLength | = 0) |
-
Creation of a Binary using length and data.
- Parameters:
-
- iLengthToCopy
- : The number of characters to take into account Legal values: If length is <= 0, an empty Binary will be created,
If length is > SHRT_MAX, a Binary of size SHRT_MAX will be created
- iAreaToCopy
- : The pointer to the binary value If iAreaToCopy is empty (=NULL), an empty Binary will be created
- iMaxLength
- : maximal length
o ~CATDbBinary
-
Destructor.
Methods
o Build
public Build( | const | iLengthToCopy, |
| const | iZoneToCopy, |
| const | iMaxLength) |
-
Initialisation of a binary.
- Parameters:
-
- iLengthToCopy
- : The number of characters to take into account Legal values: If length is <= 0, an empty Binary will be created,
If length is > SHRT_MAX, a Binary of size SHRT_MAX will be created
- iAreaToCopy
- : The pointer to the binary value If iAreaToCopy is empty (=NULL), an empty Binary will be created
- iMaxLength
- : maximal length
o GetBinaryData
-
To get the contents of the Binary (Only the data).
o GetHexaValue
-
Converts the contents of the Binary to a hexadecimal character string.
o Reset
-
Resets a binary.
Destroy its contents and sets its size to 0.
o operator const char *
public operator const char *( | ) |
-
Cast to a Binary like area.
ie : length + data
o operator short
-
Cast to get the actual length of the Binary.
o operator!=
public operator!=( | const | iBinaryToCompare) |
-
Inequality operator.
- Parameters:
-
- iBinaryToCompare
- : the binary to compare.
o operator<<
public operator<<( | const | iBinaryToConcatenate) |
-
Concatenation from a Binary operator.
- Parameters:
-
- iBinaryToConcatenate
- : the binary to concatenate.
o operator+
public operator+( | const | iBinaryToAdd) |
-
Addition from a Binary operator.
- Parameters:
-
- iBinaryToAdd
- : the binary to add.
o operator=
public operator=( | const | iBinaryToAffect) |
-
Assignment from a CATDbBinary instance operator.
- Parameters:
-
- iBinaryToAffect
- : the binary to assign
o operator==
public operator==( | const | iBinaryToCompare) |
-
Equality operator.
- Parameters:
-
- iBinaryToCompare
- : the binary to compare.
This object is included in the file: CATDbBinary.h
If needed, your Imakefile.mk should include the module: JS0GROUP
Copyright © 1999-2015, Dassault Systèmes. All rights reserved.