Specifications
The Design Notes API 293
BOOL FilePathToLocalURL()
Description
Converts the specified local drive path to a file:// URL.
Arguments
const char* drivePath, char* localURLBuf, int localURLMaxLen
• The first argument is a string that contains the full drive path.
• The second argument is the buffer where the file:// URL should be stored.
• The third argument is the maximum size of localURLBuf.
Returns
A Boolean value that indicates whether the operation is successful; stores the file:// URL in
localURLBuf.
BOOL GetNote()
Description
Gets the value of the specified key in the specified Design Notes file.
Arguments
FileHandle noteHandle, const char keyName[64], char* valueBuf, int valueBufLength
• The first argument is the file handle that OpenNotesFile() returns.
• The second argument is a string that contains the name of the key.
• The third argument is the buffer where the value should be stored.
• The fourth argument is the integer that GetNoteLength(noteHandle, keyName) returns,
which indicates the maximum length of the value buffer.
Returns
A Boolean value that indicates whether the operation is successful; stores the value of the key in
valueBuf.
Example
The following code gets the value of the comments key in the Design Notes file that is associated
with welcome.html:
FileHandle noteHandle = OpenNotesFile("file:///c|/sites/avocado8/¬
iwjs/welcome.html");
if(noteHandle > 0){
int valueLength = GetNoteLength( noteHandle, "comments");
char* valueBuffer = new char[valueLength + 1];
GetNote(noteHandle, "comments", valueBuffer, valueLength + 1);
printf("Comments: %s",valueBuffer);
CloseNotesFile(noteHandle);
}