EDOBE XDOM PMML Manual de usuario Pagina 57

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 98
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 56
57
These methods set and get a name associated with the CNK object.
The initial value for name is
NULL.
This is a good opportunity to mention several aspects related to string
properties. First, string properties can be
NULL, and code that
retrieves these values should check for that. Second, any string
properties that an object needs to keep around should be copied. For
example, the object cannot assume that the string passed into
setName
will live longer than the call to
setName. Putting it another way, a
CNK object "owns" the storage for any string properties it has. To
copy a string into new storage, use the
copyString utility function
described below. Third, the
const char* declarations specify that the
object will not modify the string passed into it, and that it does not
allow the external users to modify this string. These rules should be
followed for other CNK objects.
CNKObj::
void setError(const char* error);
void setError(const char* error, const char* val);
void setError(const char* error, int val);
void setError(const char* error, long val);
void setError(const char* error, double val);
const char* getError();
These methods set and get an error string associated with a CNK
object. Initially the error value is NULL, indicating no error. If an
error occurs during any operation on an object, its error string should
be set to a string describing the error. You shouldn't do anything with
an object if it has an error, other than setting its properties, and calling
init() (which should clear the error string).
Because
getError() returns NULL for no error, it can be used in code
such as
"if (xx.getError()) ...".
The two-argument methods for
setError are convenient for creating
common error strings. They format and save an error string of the
form
"<firstarg>: <secondarg>". For example, setError("bad
arg", 34)
will set the error string to "bad arg: 34".
CNKObj::
// message severity levels
enum severity_enum { severity_debug,
severity_verbose,
severity_information,
Vista de pagina 56
1 2 ... 52 53 54 55 56 57 58 59 60 61 62 ... 97 98

Comentarios a estos manuales

Sin comentarios