LayerAS_Layer
ObjectASAtom

ASAtom objects are hashed tokens that Acrobat uses in place of strings to optimize performance (it is much faster to compare ASAtom objects than strings). ASAtom methods convert between strings and ASAtom objects.



Define Summary
 Define
 ASAtomNull
Typedef Summary
 Typedef
 ASAtom
Method Summary
 Method
 
ASBool ASAtomExistsForString(const char* nameStr, ASAtom* atom)
Tests whether an ASAtom exists for the specified string.
 
ASAtom ASAtomFromString(const char* nameStr)
Gets the ASAtom for the specified string. You can also use this method to create an ASAtom, since it creates one for the string if one does not already exist.
 
const char* ASAtomGetString(ASAtom atm)
Gets the string associated with the specified ASAtom.
Defines Detail
ASAtomNull 
Product availability: All
Platform availability: All

Syntax

#define ASAtomNull ASMAXUns32

Examples

go to source arrow ASAtom xObjName = ASAtomNull;
go to source arrow if (xObjName != ASAtomNull) {
go to source arrow asAtomVal = ASCabGetAtom(theCab, theKey, ASAtomNull);

more...

File: CoreExpT.h
Line: 264

Typedefs Detail
ASAtom 
Product availability: All
Platform availability: All

Syntax

typedef ASUns32 ASAtom;

Examples

go to source arrow ASAtom color_space = PDEColorSpaceGetName(gfx_state.fillColorSpec.space);
go to source arrow ASAtom kidType;
go to source arrow ASAtom xObjName = ASAtomNull;

more...

File: CoreExpT.h
Line: 263



Method Detail
ASAtomExistsForString()
Product availability: All
Platform availability: All

Syntax

ASBool ASAtomExistsForString(const char* nameStr, ASAtom* atom)

Tests whether an ASAtom exists for the specified string.

Parameters

nameStr — 

The string to test.

 
atom — 

(Filled by the method, may be NULL) If the ASAtom corresponding to nameStr already exists, it is returned in atom. Pass NULL to simply check whether the ASAtom already exists.

Returns

true if an ASAtom already exists for nameStr, false otherwise.

See Also

ASAtomFromString
ASAtomGetCount (Only available with PDF Library SDK)
ASAtomGetString

Since

PI_ACROSUPPORT_VERSION >= 0x00020000

File: CorProcs.h
Line: 123
ASAtomFromString() 
Product availability: All
Platform availability: All

Syntax

ASAtom ASAtomFromString(const char* nameStr)

Gets the ASAtom for the specified string. You can also use this method to create an ASAtom, since it creates one for the string if one does not already exist.

If an ASAtom already exists for nameStr, the existing ASAtom is returned. Thus, ASAtom objects may be compared for equality of the underlying string.

Because ASAtom objects cannot be deleted, they are useful for strings that are used many times in an Acrobat viewer session, but are not recommended for strings that have a short lifetime. For the same reason, it is not a good idea to create large numbers of ASAtom objects.

Parameters

nameStr — 

The string for which an ASAtom is created.

Returns

The ASAtom corresponding to nameStr.

See Also

ASAtomExistsForString
ASAtomGetCount (Only available with the PDF Library SDK)
ASAtomGetString

Since

PI_ACROSUPPORT_VERSION >= 0x00020000

Examples

go to source arrow if (color_space == ASAtomFromString("DeviceCMYK")){
go to source arrow pdeFontAttrs.name = ASAtomFromString(myGlyphData.font);
go to source arrow sysEncoding = PDSysEncodingCreateFromCMapName(ASAtomFromString(myGlyphData.encodingName));

more...

File: CorProcs.h
Line: 107
ASAtomGetString() 
Product availability: All
Platform availability: All

Syntax

const char* ASAtomGetString(ASAtom atm)

Gets the string associated with the specified ASAtom.

Parameters

atm — 

The ASAtom whose string is obtained.

Returns

The string corresponding to atom. It returns an empty string if atom == ASAtomNull, or NULL if the atom has not been defined.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00020000

Examples

go to source arrow const char *name = ASAtomGetString(xObjName);
go to source arrow sprintf(strBuf, "Key = %s, ASAtom content = %s\n", theKey, ASAtomGetString(asAtomVal));
go to source arrow string strTmpFsName = ASAtomGetString(tmpFileSys->getFileSysName());

more...

File: CorProcs.h
Line: 135




 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/pdfl_sdk/9/PDFL_SDK9_HTMLHelp/API_References/Acrobat_API_Reference/AS_Layer/ASAtom.html