Skip Headers
Oracle® Database XML C++ API Reference
11g Release 2 (11.2)

Part Number E10771-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub
CPXML01000

1 Package Ctx APIs for C++

Ctx is the namespace for TCtx XML context related types and interfaces.

This chapter contains the following sections:

See Also:

CPXML2138

Ctx Datatypes

Table 1-1 summarizes the datatypes of the Ctx package.

CPXML2139Table 1-1 Summary of Datatypes; Ctx Package

Datatype Description

encoding

A single supported encoding.

encodings

An array of encodings.


CPXML2140

encoding

A single supported encoding.

CPXML2141Definition

typedef struct encoding {
   oratext *encname;
   oratext *encvalue;
} encoding;
CPXML2142

encodings

An array of encodings.

CPXML2143Definition

typedef struct encodings {
   unsigned num;
   encoding *enc; 
} encodings;
CPXML01020

MemAllocator Interface

Table 1-2 summarizes the methods available through the MemAllocator interface.

CPXML2144Table 1-2 Summary of MemAllocator Methods; Ctx Package

Function Summary

alloc()

Allocates memory of given size.

dealloc()

Deallocate memory pointed to by the argument.

~MemAllocator()

Virtual destructor - interface level handle to actual destructors.


CPXML2145

alloc()

This is a virtual member function that defines a prototype for user defined allocator functions

CPXML2146Syntax

virtual void* alloc(
   ub4 size) = 0;
Parameter Description
size
memory size

CPXML2147

dealloc()

This is a virtual member function that defines a prototype for user defined deallocator functions. Such deallocators are supposed to deallocate memory allocated by the alloc member functions

CPXML2148Syntax

virtual void dealloc(
   void* ptr) = 0;
Parameter Description
ptr
pointer to previously allocated memory

CPXML2149

~MemAllocator()

It provides an interface level handle to actual destructors that can be invoked without knowing their names or implementations

CPXML2150Syntax

virtual ~MemAllocator() {}
CPXML01030

TCtx Interface

Table 1-3 summarizes the methods available through the TCtx interface.

CPXML2151Table 1-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.


CPXML2152

TCtx()

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

CPXML2153Returns

(TCtx) Context object

CPXML2154

getEncoding()

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.

CPXML2155Syntax

oratext* getEncoding() const;

CPXML2156Returns

(oratext *) name of data encoding

CPXML2157

getErrHandler()

This member functions returns Error Handler provided by the user when the context was created, or NULL if none were provided.

CPXML2158Syntax

ErrorHandler* getErrHandler() const;

CPXML2159Returns

(ErrorHandler *) Pointer to the Error Handler object, or NULL

CPXML2160

getMemAllocator()

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

CPXML2161Syntax

MemAllocator* getMemAllocator() const;

CPXML2162Returns

(MemAllocator*) Pointer to the memory allocator object

CPXML2163

isSimple()

Returns a flag saying whether the context's data encoding is "simple", single-byte for each character, like ASCII or EBCDIC.

CPXML2164Syntax

boolean isSimple() const;

CPXML2165Returns

(boolean) TRUE of data encoding is "simple", FALSE otherwise

CPXML2166

isUnicode()

Returns a flag saying whether the context's data encoding is Unicode, UTF-16, with two-byte for each character.

CPXML2167Syntax

boolean isUnicode() const;

CPXML2168Returns

(boolean) TRUE if data encoding is Unicode, FALSE otherwise

CPXML2169

~TCtx()

Destructor - should be called by the user the context object is no longer needed

CPXML2170Syntax

~Tctx();
Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Page

  • Ctx Datatypes
    • encoding
    • encodings
  • MemAllocator Interface
    • alloc()
    • dealloc()
    • ~MemAllocator()
  • TCtx Interface
    • TCtx()
    • getEncoding()
    • getErrHandler()
    • getMemAllocator()
    • isSimple()
    • isUnicode()
    • ~TCtx()

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF