Returns a newly allocated buffer containing a copy of the Cos object's name as a NULL
-terminated string. Upon return, nBytes
contains the number of bytes in the string. CosCopyNameStringValue
()
never returns NULL
; it raises an exception if the allocation fails. The client is responsible for freeing the result by calling ASfree
()
.
Unlike Cos strings, the strings corresponding to Cos names are NULL
-terminated.
This routine will avoid creating an ASAtom
corresponding to the object's name and is generally more efficient than copying the value returned by ASAtomGetString
(CosNameValue(obj))
. ( ASAtom
objects consume global memory that is not deallocated.)
An out-of-memory exception is raised if insufficient memory is available.
char
*
CosCopyNameStringValue(
CosObj
obj
,
ASTCount
*
nBytes
);
obj | IN A Cos name object.
|
nBytes |
NULL
-terminated string. ASAtom
CosNameValue(
CosObj
obj
);
obj | The object of type
CosName whose value is obtained. |
The ASAtom
corresponding to the specified name object. An ASAtom
can be converted to a string using ASAtomGetString
()
. Note that CosCopyNameStringValue
()
can be used to obtain the name as a string, without creating an ASAtom
( ASAtom
objects consume global memory that is not deallocated).
An exception is raised if obj
has the wrong type, if storage is exhausted, or if file access fails.
CosObj
CosNewName(
CosDoc
dP
,
ASBool
indirect
,
ASAtom
name
);
dP | The document in which the new name is used.
|
indirect | If
true , it creates the name as an indirect object, and sets the document's PDDocNeedsSave flag (see PDDocFlags ) flag. If false , it creates the name as a direct object. |
name | The
ASAtom corresponding to the name to create. A C string can be converted to an ASAtom using ASAtomFromString () . Note that a name object can be created directly from a C string, without creating an ASAtom , by using CosNewNameFromString () . |
CosObj
CosNewNameFromString(
CosDoc
dP
,
ASBool
indirect
,
const
char
*
namestring
);
dP | The document in which the new name is used.
|
indirect | If
true , it creates the name as an indirect object, and sets the document's PDDocNeedsSave flag (see PDDocFlags ) flag. If false , it creates the name as a direct object. |
namestring | The name to create. This routine will not create an
ASAtom corresponding to namestring and is generally more efficient than CosNewName () . ( ASAtom objects consume global memory that is not deallocated.) |