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: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

#define ASAtomNull ASMAXUns32

Examples

go to source arrow 0, ASAtomNull, 0, 0, 0, 0);

File: CoreExpT.h
Line: 135

Typedefs Detail
ASAtom 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef ASUns32 ASAtom;

Examples

go to source arrowstatic ASAtom sDeviceRGB_K, sDeviceCMYK_K, sDeviceGray_K;
go to source arrow ASAtom csAtom = sDeviceRGB_K;
go to source arrow ASAtom encname;

File: CoreExpT.h
Line: 134



Method Detail
ASAtomExistsForString()
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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: 132
ASAtomFromString() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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 ASAtomFromString("Cstring"),
go to source arrow filterRec.spec[0].name = ASAtomFromString("FlateDecode");
go to source arrow CosDictPut(cosPage, ASAtomFromString("Contents"), cosContents);

more...

File: CorProcs.h
Line: 116
ASAtomGetString() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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 strcpy(buf, ASAtomGetString(PDActionGetSubtype(pdac)));
go to source arrow strcpy_safe(buf, sizeof(buf), ASAtomGetString(PDSysFontGetName(sysFont)));
go to source arrow strcpy_safe(fontEncoding, sizeof(fontEncoding), ASAtomGetString(encname));

more...

File: CorProcs.h
Line: 144