beautypg.com

Bool getsiterootforfile() – Adobe Dreamweaver API Reference CS5 User Manual

Page 34

background image

29

DREAMWEAVER API REFERENCE

The Design Notes API

Last updated 8/27/2013

The keyBufArray[64] argument is the buffer array where the keys are stored.

The keyArrayMaxLen argument is the integer that

GetNotesKeyCount(noteHandle)

returns, indicating the

maximum number of items in the key buffer array.

Returns
A Boolean value:

true

indicates the operation is successful;

false

otherwise. The keyBufArray argument receives the

key names.

Example
The following code prints the key names and values of all the keys in the Design Notes file that are associated with the
welcome.html file:

typedef char[64] InfoKey;

FileHandle noteHandle = OpenNotesFile("file:///c|/sites/avocado8/iwjs/welcome.html");
if (noteHandle > 0){

int keyCount = GetNotesKeyCount(noteHandle);
if (keyCount <= 0)

return;

InfoKey* keys = new InfoKey[keyCount];
BOOL succeeded = GetNotesKeys(noteHandle, keys, keyCount);

if (succeeded){

for (int i=0; i < keyCount; i++){

printf("Key is: %s\n", keys[i]);
printf("Value is: %s\n\n", GetNote(noteHandle, keys[i]);

}

}
delete []keys;

}
CloseNotesFile(noteHandle);

BOOL GetSiteRootForFile()

Description
This function determines the site root for the specified Design Notes file.

Arguments

const char*

filePath

, char*

siteRootBuf

, int

siteRootBufMaxLen

, {InfoPrefs

* infoPrefs}

The filePath argument is the file://URL of the file for which you want the site root.

The siteRootBuf argument is the buffer where the site root is stored.

The siteRootBufMaxLen argument is the maximum size of the buffer that siteRootBuf references.

The infoPrefs argument, which is optional, is a reference to a

struct

in which the preferences for the site are stored.

Returns
A Boolean value:

true

indicates the operation is successful;

false

otherwise. The siteRootBuf argument receives the

address of the buffer that stores the site root. If you specify the infoPrefs argument, the function also returns the Design
Notes preferences for the site. The

InfoPrefs

struct has two variables:

bUseDesignNotes

and

bUploadDesignNotes

,

both of type

BOOL

.