Header Header

prDoc Class Reference
[Document handling]

Inheritance diagram for prDoc:

gxHandle gxHANDLE

List of all members.


Detailed Description

This class represents a recognized document structure in the PR system.

Public Member Functions

 ~prDoc () throw (gxError)
 Destructor.
void Dispose (void)
 Disposes the class.
bool Copy (prDoc &src) throw (gxError)
 Copies an existing prDoc object.
bool Free (void) throw (gxError)
 Clears the prDoc object, deletes the document.
gxVariant * ToVariant () throw (gxError)
 Embedds the prDoc object into a variant.
prDoc * GetDocPart (int ix) throw (gxError)
 Returns a document task result from a root document.
int Code (void) const throw (gxError)
 Returns the code of the document.
int Status (void) const throw (gxError)
 Returns the status of the document.
bool Field (int field_code, char *text, int stext, int index=0) const throw (gxError)
 Returns the data of a field in string format (ASCII version).
bool Field (int field_code, char *text, int *stext, int index=0) const throw (gxError)
 Returns the data of a field in string format (ASCII version).
bool Field (int field_code, wchar_t *text, int stext, int index=0) const throw (gxError)
 Returns the data of a field in string format (Unicode version).
bool Field (int field_code, wchar_t *text, int *stext, int index=0) const throw (gxError)
 Returns the data of a field in string format (Unicode version).
bool Field (int field_code, void *data, int sdata, int index=0) const throw (gxError)
 Returns the data of a field (Binary version).
bool Field (int field_code, void *data, int *sdata, int index=0) const throw (gxError)
 Returns the data of a field (Binary version).
gxImage * FieldImage (int field_code) const throw (gxError)
 Returns the image of a field.
gxImage * FieldImage (int field_code, int index) const throw (gxError)
 Returns the image of a field.
gxOutStr Field (int field_code) const throw (gxError)
 Returns the data of a field in string format (Unicode version).
gxOutStr Field (int field_code, int index) const throw (gxError)
 Returns the data of a field in string format (Unicode version).
gxOutAStr FieldA (int field_code) const throw (gxError)
 Returns the data of a field in string format (ASCII version).
gxOutAStr FieldA (int field_code, int index) const throw (gxError)
 Returns the data of a field in string format (ASCII version).
gxVariant * FieldV (int field_code, int index) const throw (gxError)
 Returns a field (Variant version).
int FieldStatus (int field_code) const throw (gxError)
 Returns the error status of a field.
int FieldStatus (int field_code, int index) const throw (gxError)
 Returns the error status of a field.
bool Prop (int field_code, int prop_code, void *data, int *sdata, int *data_type) const throw (gxError)
 Returns a property of a field.
int PropI32 (int field_code, int prop_code) const throw (gxError)
 Returns a four bytes integer property of a field.
int PropType (int field_code, int prop_code) const throw (gxError)
 Returns a property field from the document structure.
bool IsValid (void) const
 Checks if the document structure and the handle is valid.
bool Save (const wchar_t *filename, int filetype=PR_DFF_ZIPPED) const throw (gxError)
 Saves a document to a mass storage device in the specific file format (Unicode version).
bool Save (const char *filename, int filetype=PR_DFF_ZIPPED) const throw (gxError)
 Saves a document to a mass storage device in the specific file format (ASCII version).
bool SaveToMem (gxu8 **buffer, int *buflen, int filetype=PR_DFF_XML) const throw (gxError)
 Saves a document to memory in the specific file format.
bool Save (gxInStr filename, int filetype=PR_DFF_ZIPPED) const throw (gxError)
 Saves a document to a mass storage device in the specific file format (Unicode version).
bool Save (gxInAStr filename, int filetype=PR_DFF_ZIPPED) const throw (gxError)
 Saves a document to a mass storage device in the specific file format (ASCII version).
bool Open (const wchar_t *modulename, const wchar_t *groupname=(const wchar_t *) 0)
bool Open (const char *modulename, const char *groupname=(const char *) 0)
bool Open (gxInStr modulename, gxInStr groupname)
bool Open (gxInStr modulename)
bool Open (gxInAStr modulename, gxInAStr groupname)
bool Open (gxInAStr modulename)
bool Close (void)
bool GetInfo (const gxMODULEINFO **moduleinfo)
bool GetDependencies (const unsigned int **groupcodes)
bool Call (int callcode, void *params)
bool GetProperty (const wchar_t *name, wchar_t *string, int maxlen)
std::wstring GetProperty (const wchar_t *name)
bool GetProperty (const char *name, char *string, int maxlen)
std::string GetProperty (const char *name)
gxOutStr GetProperty (gxInStr name)
gxOutAStr GetProperty (gxInAStr name)
bool GetProperty (const wchar_t *name, int *ivalue)
bool GetProperty (const char *name, int *ivalue)
bool GetProperty (const wchar_t *name, double *fvalue)
bool GetProperty (const char *name, double *fvalue)
int GetPropertyInt (const wchar_t *name)
int GetPropertyInt (gxInStr name)
int GetPropertyInt (const char *name)
int GetPropertyInt (gxInAStr name)
double GetPropertyFloat (const wchar_t *name)
double GetPropertyFloat (gxInStr name)
double GetPropertyFloat (const char *name)
double GetPropertyFloat (gxInAStr name)
bool SetProperty (const wchar_t *name, const wchar_t *string)
bool SetProperty (const char *name, const char *string)
bool SetProperty (gxInStr name, gxInStr str)
bool SetProperty (gxInAStr name, gxInAStr str)
bool SetProperty (const wchar_t *name, int ivalue)
bool SetProperty (const char *name, int ivalue)
bool SetProperty (gxInStr name, int ivalue)
bool SetProperty (gxInAStr name, int ivalue)
bool SetProperty (const wchar_t *name, double fvalue)
bool SetProperty (const char *name, double fvalue)
bool SetProperty (gxInStr name, double fvalue)
bool SetProperty (gxInAStr name, double fvalue)
bool SaveProperties (const wchar_t *name, int level=0)
bool SaveProperties (const char *name, int level=0)
bool SaveProperties (gxInStr name, int level)
bool SaveProperties (gxInStr name)
bool SaveProperties (gxInAStr name, int level=0)
bool MPStartTransaction (void)
bool MPCommit (void)

Public Attributes

gxu32 handle

Constructor & Destructor Documentation

~prDoc (  )  throw (gxError) [inline]

Destructor.


Member Function Documentation

void Dispose ( void   )  [inline]

Disposes the class.

Reimplemented from gxHandle.

References gxHandle::Dispose().

bool Copy ( prDoc &  src  )  throw (gxError) [inline]

Copies an existing prDoc object.

Parameters:
src An existing prDoc object.
Returns:
On success: non-zero ( see gx_geterror() )

References gx_duplicatevariant(), and gx_unrefvariant().

bool Free ( void   )  throw (gxError) [inline]

Clears the prDoc object, deletes the document.

Returns:
On success: non-zero ( see gx_geterror() )

References gx_unrefvariant().

gxVariant* ToVariant (  )  throw (gxError) [inline]

Embedds the prDoc object into a variant.

Returns:
An exception is thrown or false is returned in case of error.

References gxSystem::ClearError(), GX_ENOMEM, gx_refvariant(), and gxSystem::SetError().

prDoc* GetDocPart ( int  ix  )  throw (gxError) [inline]

Returns a document task result from a root document.

Parameters:
ix Ordinal number of the requested task.
Returns:
A prDoc object contains the data of the document. On error an empty object is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gxSystem::ClearError(), GX_ENOMEM, gx_getvariantbypath(), gx_unrefvariant(), PRV_TASKLIST, and gxSystem::SetError().

int Code ( void   )  const throw (gxError) [inline]

Returns the code of the document.

The possible document types are defined in the PR_DOCUMENT enumeration.

Returns:
If a document is copied to the class the function returns its code. If there is no document copied it returns -1.

References pr_getdocumentstatus().

int Status ( void   )  const throw (gxError) [inline]

Returns the status of the document.

The status of the document is the highest error code between the field errors. The error codes are defined in the PR_CHKERR enumeration.

Returns:
If a document is copied to the class the function returns its status. If there is no document copied it returns -1.

References pr_getdocumentstatus().

bool Field ( int  field_code,
char *  text,
int  stext,
int  index = 0 
) const throw (gxError) [inline]

Returns the data of a field in string format (ASCII version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
text Buffer for the string of the field.
stext Size of the string buffer.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
On success: non-zero ( see gx_geterror() )

bool Field ( int  field_code,
char *  text,
int *  stext,
int  index = 0 
) const throw (gxError) [inline]

Returns the data of a field in string format (ASCII version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
text Buffer for the string of the field.
stext This buffer must contain the size of the string buffer, and returns the size of the string.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
On success: non-zero ( see gx_geterror() )

References gx_convertvariantchild(), GX_ENOENT, gx_geterror(), gx_poperror(), gx_pusherror(), gx_unrefvariant(), GX_VARIANT_ASCII, pr_getfieldfromdoc(), and PRV_FIELDVALUE.

bool Field ( int  field_code,
wchar_t *  text,
int  stext,
int  index = 0 
) const throw (gxError) [inline]

Returns the data of a field in string format (Unicode version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
text Buffer for the string of the field.
stext Size of the string buffer.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
On success: non-zero ( see gx_geterror() )

bool Field ( int  field_code,
wchar_t *  text,
int *  stext,
int  index = 0 
) const throw (gxError) [inline]

Returns the data of a field in string format (Unicode version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
text Buffer for the string of the field.
stext This buffer must contain the size of the string buffer, and returns the size of the string.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
On success: non-zero ( see gx_geterror() )

References gx_convertvariantchild(), GX_ENOENT, gx_geterror(), gx_poperror(), gx_pusherror(), gx_unrefvariant(), GX_VARIANT_UNICODE, pr_getfieldfromdoc(), and PRV_FIELDVALUE.

bool Field ( int  field_code,
void *  data,
int  sdata,
int  index = 0 
) const throw (gxError) [inline]

Returns the data of a field (Binary version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
data Buffer for the data of the field.
sdata Size of the data buffer.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
On success: non-zero ( see gx_geterror() )

bool Field ( int  field_code,
void *  data,
int *  sdata,
int  index = 0 
) const throw (gxError) [inline]

Returns the data of a field (Binary version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
data Buffer for the data of the field.
sdata This buffer must contain the size of the data buffer, and returns the size of the data.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
On success: non-zero ( see gx_geterror() )

References gx_convertvariantchild(), GX_ENOENT, gx_geterror(), gx_poperror(), gx_pusherror(), gx_unrefvariant(), GX_VARIANT_BINARY, pr_getfieldfromdoc(), and PRV_FIELDVALUE.

gxImage* FieldImage ( int  field_code  )  const throw (gxError) [inline]

Returns the image of a field.

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
Returns:
The image needed.

gxImage* FieldImage ( int  field_code,
int  index 
) const throw (gxError) [inline]

Returns the image of a field.

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
The image needed.

References gxSystem::ClearError(), GX_ENOENT, GX_ENOMEM, gx_geterror(), gx_imagefromvariant(), gx_poperror(), gx_pusherror(), gx_unrefimage(), gx_unrefvariant(), pr_getfieldimage(), and gxSystem::SetError().

gxOutStr Field ( int  field_code  )  const throw (gxError) [inline]

Returns the data of a field in string format (Unicode version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
Returns:
The data of the field.

gxOutStr Field ( int  field_code,
int  index 
) const throw (gxError) [inline]

Returns the data of a field in string format (Unicode version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
The data of the field.

References gx_convertvariantchild(), GX_ENOENT, gx_geterror(), gx_poperror(), gx_pusherror(), gx_unrefvariant(), GX_VARIANT_UNICODE, pr_getfieldfromdoc(), and PRV_FIELDVALUE.

gxOutAStr FieldA ( int  field_code  )  const throw (gxError) [inline]

Returns the data of a field in string format (ASCII version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
Returns:
The data of the field.

gxOutAStr FieldA ( int  field_code,
int  index 
) const throw (gxError) [inline]

Returns the data of a field in string format (ASCII version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
The data of the field.

References gx_convertvariantchild(), GX_ENOENT, gx_geterror(), gx_poperror(), gx_pusherror(), gx_unrefvariant(), GX_VARIANT_ASCII, pr_getfieldfromdoc(), and PRV_FIELDVALUE.

gxVariant* FieldV ( int  field_code,
int  index 
) const throw (gxError) [inline]

Returns a field (Variant version).

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
The field in variant data type.

References GX_ENOMEM, gx_unrefvariant(), pr_getfieldfromdoc(), and gxSystem::SetError().

int FieldStatus ( int  field_code  )  const throw (gxError) [inline]

Returns the error status of a field.

The error codes are defined in the PR_CHKERR enumeration.

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
Returns:
If a document is copied to the class the function returns the fields' status. If there is no document copied or field is not exist it returns -1.

int FieldStatus ( int  field_code,
int  index 
) const throw (gxError) [inline]

Returns the error status of a field.

The error codes are defined in the PR_CHKERR enumeration.

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
index The index for the list of possible results if more than one field was found with the same id.
Returns:
If a document is copied to the class the function returns the fields' status. If there is no document copied or field is not exist it returns -1.

References gx_convertvariantchild(), GX_ENOENT, gx_geterror(), gx_poperror(), gx_pusherror(), gx_unrefvariant(), GX_VARIANT_INT, pr_getfieldfromdoc(), and PRV_CHECKSUM.

bool Prop ( int  field_code,
int  prop_code,
void *  data,
int *  sdata,
int *  data_type 
) const throw (gxError) [inline]

Returns a property of a field.

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
prop_code The id of the needed property.
data Preallocated buffer for the data.
sdata Size of the preallocated buffer. On return it will contain the size of the returned data.
data_type On return it will contain the type of the returned data ( see prPropFieldItem::DATA_TYPES enumeration).
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References pr_getpropfromdoc().

int PropI32 ( int  field_code,
int  prop_code 
) const throw (gxError) [inline]

Returns a four bytes integer property of a field.

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
prop_code The id of the needed property.
Returns:
The value of the int property

References pr_getpropfromdoc().

int PropType ( int  field_code,
int  prop_code 
) const throw (gxError) [inline]

Returns a property field from the document structure.

Parameters:
field_code The id of the needed field. The possible ids are defined in the PR_DOCFIELD enumeration.
prop_code The id of the needed property.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References pr_getpropfromdoc().

bool IsValid ( void   )  const [inline]

Checks if the document structure and the handle is valid.

Returns:
In case of valid document the return value is true.

Reimplemented from gxHandle.

References gxHandle::IsValid().

bool Save ( const wchar_t *  filename,
int  filetype = PR_DFF_ZIPPED 
) const throw (gxError) [inline]

Saves a document to a mass storage device in the specific file format (Unicode version).

Parameters:
filename Name of the file.
filetype Format of the file ( see PR_DOCFILEFORMATS ).
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References pr_savedocument().

bool Save ( const char *  filename,
int  filetype = PR_DFF_ZIPPED 
) const throw (gxError) [inline]

Saves a document to a mass storage device in the specific file format (ASCII version).

Parameters:
filename Name of the file.
filetype Format of the file ( see PR_DOCFILEFORMATS ).
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References pr_savedocument().

bool SaveToMem ( gxu8 **  buffer,
int *  buflen,
int  filetype = PR_DFF_XML 
) const throw (gxError) [inline]

Saves a document to memory in the specific file format.

Parameters:
buffer Pointer to the memory area pointer that is large enough or NULL.
buflen Size of the memory area.
filetype Format of the file ( see PR_DOCFILEFORMATS ).
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References pr_savedocumenttomem().

bool Save ( gxInStr  filename,
int  filetype = PR_DFF_ZIPPED 
) const throw (gxError) [inline]

Saves a document to a mass storage device in the specific file format (Unicode version).

Parameters:
filename Name of the file.
filetype Format of the file ( see PR_DOCFILEFORMATS ).
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References pr_savedocument().

bool Save ( gxInAStr  filename,
int  filetype = PR_DFF_ZIPPED 
) const throw (gxError) [inline]

Saves a document to a mass storage device in the specific file format (ASCII version).

Parameters:
filename Name of the file.
filetype Format of the file ( see PR_DOCFILEFORMATS ).
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References pr_savedocument().


Generated  for Passport Reader
(c) ARH Inc.