gtpc2me9 | C/C++ Language Support User's Guide |
This function determines if a persistent identifier (PID) is for a collection.
Format
#include <c$to2.h> BOOL TO2_isCollection (const TO2_PID_PTR pid_ptr, TO2_ENV_PTR env_ptr);
Normal Return
Error Return
An error return is indicated by a zero return value and a nonzero error code. When zero is returned, use the TO2_getErrorCode function to determine the specific error code. For more information, see Error Handling.
The following error codes are common for this function:
TO2_ERROR_ENV
TO2_ERROR_METHOD
TO2_ERROR_PID
TO2_ERROR_ZERO_PID
Programming Considerations
Examples
The following example determines if a specified PID represents a TPFCS collection.
#include <c$to2.h> /* TO2 API function prototypes */ #include <stdio.h> /* APIs for standard I/O functions */ TO2_ENV_PTR env_ptr; /* Pointer to TO2 Environment */ TO2_PID blob; TO2_ERR_CODE err_code; /* TO2 error code value */
·
·
·
if (TO2_isCollection(&blob, env_ptr) == TO2_IS_FALSE) { err_code = TO2_getErrorCode(env_ptr); if (err_code != 0) { printf("TO2_isCollection failed!\n"); process_error(env_ptr); } else { printf("Object IS NOT a TPFCS Collection.\n"); } } else { printf("Object IS a TPFCS Collection.\n"); }
Related Information