Table 14-3 summarizes the methods of available through the TCtx
interface.
Table 14-3 Summary of TCtx Methods; Ctx Package
Function | Summary |
---|---|
TCtx
|
Class constructor. |
getEncoding
|
Get data encoding in use by XML context. |
getErrHandler
|
Get Error Handler provided by the user. |
getMemAllocator
|
Get memory allocator. |
isSimple
|
Get a flag that indicates if data encoding is simple. |
isUnicode
|
Get a flag indicating if data encoding is Unicode. |
~TCtx
|
Destructor - clears space and destroys the implementation. |
TCtx constructor. It throws XmlException
if it fails to create a context object.
Syntax | Description |
---|---|
TCtx() throw (XMLException) |
This constructor creates the context object and initializes it with default values of parameters. |
TCtx( oratext* name, ErrorHandler* errh = NULL, MemAllocator* memalloc = NULL, encodings* encs = NULL) throw (XMLException) |
This constructor creates the context object and initializes it with parameter values provided by the user. |
TCtx( oratext* name, up4 inpblksize, ErrorIfs* errh = NULL, MemAllocator* memalloc = NULL, encodings* encs = NULL) throw (XMLException) |
This constructor creates the context object and initializes it with parameter values provided by the user. Takes an additional parameter for memory block size from input source. |
Parameter | Description |
---|---|
name |
user defined name of the context |
errh |
user defined error handler |
memalloc |
user defined memory allocator |
encs |
user specified encodings |
inpblksize |
memory block size for input source |
(TCtx)
Context object
Returns data encoding in use by XML context. Ordinarily, the data encoding is chosen by the user, so this function is not needed. However, if the data encoding is not specified, and allowed to default, this function can be used to return the name of that default encoding.
oratext* getEncoding() const;
(oratext *)
name of data encoding
This member functions returns Error Handler provided by the user when the context was created, or NULL
if none were provided.
ErrorHandler* getErrHandler() const;
(ErrorHandler *)
Pointer to the Error Handler object, or NULL
This member function returns memory allocator provided by the user when the context was created, or default memory allocator. It is important that this memory allocator is used for all C level memory allocations
MemAllocator* getMemAllocator() const;
(MemAllocator*)
Pointer to the memory allocator object
Returns a flag saying whether the context's data encoding is "simple", single-byte for each character, like ASCII or EBCDIC.
boolean isSimple() const;
(boolean)
TRUE
of data encoding is "simple", FALSE
otherwise
Returns a flag saying whether the context's data encoding is Unicode, UTF-16, with two-byte for each character.
boolean isUnicode() const;
(boolean)
TRUE
if data encoding is Unicode, FALSE
otherwise
Destructor - should be called by the user the context object is no longer needed
~Tctx();