RWDBBinaryVector RWDBTBuffer<unsigned char>
Member Functions | |||
isNull() length() |
operator[]() setNull() |
unsetNull() width() |
#include <rw/db/dbvector.h> RWDBBinaryVector binaryVector(width, length);
RWDBBinaryVectors are used to transfer binary arrays of width width between the application and the database via RWDBBulkReaders and RWDBBulkInserters.
In the following example, the ith element of an RWDBBinaryVector is set to hold the data Hello, and the data and width are output to the screen.
RWDBBinaryVector binaryVector(width, length); . . . binaryVector[i] = RWDBBlob("Hello", 5); . . . RWDBBinaryVectorElement element = binaryVector[i]; // print the contents of the element cout << "length of element is: " << binaryVector.width(i) << endl; cout << "the element's data is: "; unsigned char* ptr = (unsigned char*) element; for (size_t j = 0; j < binVector.width(i); ++j, ++ptr) cout.put(*ptr); cout << endl; Output: length of element is: 5 the element's data is: Hello
RWDBBinaryVector(size_t width, size_t length);
Constructs an RWDBBinaryVector of length elements, each of whose elements is width-wide.
RWDBBinaryVectorElement operator[](size_t i);
Returns an RWDBBinaryVectorElement holding a reference to the ith element of self.
RWBoolean isNull(size_t index) const;
Returns true if the indexth element of self is null, otherwise returns false. Inherited from RWDBTBuffer<unsigned char>.
size_t length() const;
Returns the number of elements in self.
void setNull(size_t index);
Sets the indexth element of self to null. Inherited from RWDBTBuffer<unsigned char>.
void unsetNull(size_t index);
Sets the indexth element of self to not null. Inherited from RWDBTBuffer<unsigned char>.
size_t width() const;
Returns the maximum width of the elements in self. Inherited from RWDBTBuffer<unsigned char>.
size_t width(size_t index);
Returns the width of the indexth element.
size_t width(size_t index, size_t w);
Assigns to the indexth element the width w, where w can be no larger than width().
©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.