Finale PDK Framework
0.54
|
Class that provides storage for text. This is to achieve platform-transparent text handling, that can handle text storage regardless of how it's done on the platform (Mac/Window/C-style/Unicode/etc). More...
#include <ff_base.h>
Public Member Functions | |
virtual const char * | ClassName () |
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child class. More... | |
virtual const PDKFRAMEWORK_CLASSID | GetClassID () |
Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has problems to resolve the true classes of inherited objects. More... | |
FCString () | |
The constructor. Defauls to an empty string. More... | |
FCString (const char *pszCString) | |
Constructor version that takes a C string as argument. | |
FCString (const eUniChar16 *pszCString) | |
virtual | ~FCString () |
The destructor. Deletes the string storage as well as the C-string pointer (if any). | |
void | AppendCharacter (eUniChar16 character) |
Appends a character to the string. More... | |
void | AppendString (FCString *pOtherString) |
Appends another string object to the string. More... | |
void | AppendCString (const char *pOtherString) |
Appends a C-style string to the string. More... | |
void | AppendInteger (int value) |
Appends an integer value (decimal) to the string. More... | |
void | AppendFloat (float value) |
Appends an floating-point value to the string. More... | |
void | AppendEOL () |
Appends a system-specific end-of-line string to the to the FCString object. More... | |
void | AssureEndingPathDelimiter () |
Makes sure that the string ends with a path delimiter (backslash or slash, depending on OS). The method will not add any delimiter to empty strings. More... | |
bool | SplitAt (int splitpointindex, FCString *pFirstString, FCString *pSecondString, bool includesplitposchar) |
Splits a string into 2 substrings at a specific split point character position. More... | |
bool | SplitToPathAndFile (FCString *pPathPart, FCString *pFilePart) |
Splits a fully qualified file path into path part and file part copies. More... | |
void | SetUserOptionsPath () |
Sets the string to the user options path on the running system. More... | |
void | SetPluginsFolderPath () |
Sets the path string to Finale's root plug-in folder. More... | |
void | SetMusicFolderPath () |
Sets the path string to Finale's music folder. More... | |
void | SetLibFolderPath () |
Sets the path string to Finale's library folder. More... | |
void | SetBackupFolderPath () |
Sets the path string to Finale's backup folder. More... | |
void | SetAutoSaveFolderPath () |
Sets the path string to Finale's auto-save folder. More... | |
void | SetTemplateFolderPath () |
Sets the path string to Finale's template folder. More... | |
void | SetTempFolderPath () |
Sets the path string to Finale's temp folder (for temporary files). More... | |
void | SetFontAnnotationFolderPath () |
Sets the path string to Finale's font annotation folder. More... | |
void | SetDocStylesFolderPath () |
Sets the path string to Finale's document styles folder. More... | |
void | SetPercussionTypesFilePath () |
Sets the full path string to Finale's percussion note types text file. This file should NEVER be modified, only read from it. More... | |
void | SetPreferencesFolderPath () |
Sets the path string to Finale's preference folder. More... | |
void | SetRunningLuaFolderPath () |
Sets the string to the folder for the running script file. The string is cleared if the script is run without a file. Only available for JW Lua. More... | |
void | SetRunningLuaFilePath () |
Sets the string to the folder for the running script file. The string is cleared if the script is run without a file. Only available for JW Lua. More... | |
void | Clear () |
Creates an empty string. More... | |
int | Compare (FCString *pString2) |
Compares string against another string. More... | |
int | CompareNoCase (FCString *pString2) |
Case insensitive version of Compare. More... | |
bool | ContainsString (FCString *pSubString) |
Returns true if the substring is found within the string. More... | |
bool | ContainsCString (const char *pszSubString) |
Returns true if the substring is found within the string. C-string version. More... | |
bool | ContainsStringFrom (FCString *pSubString, int startindex) |
Returns true if the substring is found within the string from a certain position. More... | |
bool | ContainsCStringFrom (const char *pszSubString, int startindex) |
Returns true if the substring is found from a certain position within the string. C-string version. More... | |
int | CalcStringPos (FCString *pSubString) |
Returns the first position where a substring occurs. More... | |
int | CalcCStringPos (FCString *pSubString, const char *pszSubString) |
Returns the first position where a substring occurs. C-string version. More... | |
int | CalcStringPosFrom (FCString *pSubString, int startindex) |
Returns the first position where a substring occurs, from a starting point. More... | |
int | CalcCStringPosFrom (const char *pszSubString, int startindex) |
Returns the first position where a substring occurs, from a starting point. C-string version. More... | |
void | ConvertToPascal (Str255 &pascalString) |
Converts the string contents to a Str255 pascal string. | |
void | _SetCFURLRefPath (void *cfurl) |
void * | _GetPathCFURLRef () |
bool | ContainsEnigmaTextInsert (bool only_file_info_inserts=true) |
Returns true if the text block contains a text insert. More... | |
FCStrings * | CreateEnigmaComponents () |
Creates a string collection that consists of the components from an Enigma text command (with correct syntax). More... | |
FCStrings * | CreateEnigmaStrings (bool include_non_commands=false) |
Creates a string collection of every enigma text tag found in the string. More... | |
FCFontInfo * | CreateLastFontInfo () |
Creates a FCFontInfo object with the last font information (based on the Enigma text tags) found in the string. More... | |
FCStrings * | CreateParsedStrings (const char *pszSeparators) |
Creates a collection of strings based on the separator characters. C-style string version. More... | |
FCStrings * | CreateRows () |
bool | DeleteCharacterAt (int index) |
Removes a character at the 0-based index position. More... | |
bool | DeleteCharactersAt (int index, int count) |
Removes a range of characters, starting at the 0-based index position. More... | |
void | ExtractFileExtension () |
Removes everything except the file extension part of a file name. More... | |
int | FindFirst (const char *pszSubStr) |
Returns the 0-based index for the first occurence of the substring. More... | |
int | FindLast (const char *pszSubStr) |
Returns the 0-based index for the first occurence of the substring. More... | |
int | FormatCString (const char *fmt,...) |
Formats a string using the same syntax and manner as the printf() function in C. The version of the method doesn't supports Unicode. More... | |
int | FormatString (FCString *fmt,...) |
Formats a string using the same syntax and manner as the printf() function in C. The version of the method supports Unicode on Finale 2012 and later. More... | |
void | FormatCharacterNumber (eUniChar16 character) |
Formats a 16-bit character (symbol) number to a string for presentation purposes. More... | |
const char * | GetCString () const |
Returns a C-string version of the string. More... | |
const char * | GetUTF8String () const |
Returns a C-string UTF-8 version of the string. | |
bool | CopyToUnicodeBuffer (eUniChar16 *pBuffer, int maxbufferlen=0) const |
Copies the string to a 16-bit Unicode buffer. The buffer must be big enough to have room for an ending 0. More... | |
void * | GetNSString () |
Returns a NSString* version of the string (on Cocoa only). More... | |
void | SetNSString (void *pNSString) |
Sets the string to a NSString* value. | |
int | GetInteger (int index=0) |
Converts the decimal string contents to an integer value. More... | |
int | GetHex () |
Converts the unsigned hexadecimal string to an integer value. The string can only contain valid hexadecimal characters. More... | |
float | GetFloat (int index=0) |
Converts the decimal string contents to a float value. More... | |
eUniChar16 | GetCharacterAt (int index) |
Returns the character at the index position. More... | |
int | GetLength () const |
Returns the length of the string. More... | |
const char * | GetEOL () const |
Returns the platform-specific end-of-line character(s) as a C-string. More... | |
void | Insert (const char *pszString, int insertindex=0) |
Inserts a C string to the string at a specified index position. More... | |
void | InsertString (FCString *pString, int insertindex=0) |
Inserts a string object to the string at a specified index position. More... | |
bool | IsDigit (int index) |
Returns true if the character at the specified 0-based index position is a digit (0 through 9). More... | |
bool | IsAllDigits () |
Returns true if all characters in the string are digits (0 through 9). More... | |
bool | IsNumber () |
Returns true if the string is a number. More... | |
bool | IsEqualCString (const char *pszString) |
Returns true if the string is identical with the parameter. (C-style string version.) | |
bool | IsEqual (const char *pszString) |
Returns true if the string is identical with the parameter. More... | |
bool | IsEqualString (FCString *pString) |
Returns true if the string is identical with the parameter. (FCString string version.) More... | |
bool | IsCharacter (int index, eUniChar16 character) |
Returns true if the character at the index matches the supplied character. More... | |
bool | IsCharacters (int index, const char *pChars) |
Returns true if the character at the index matches any of the supplied character. More... | |
bool | IsEmpty () |
Returns true if the string is empty. More... | |
bool | IsWhitespace (int index) |
Returns true if the character position contains a whitespace. More... | |
bool | IsEnigmaCommand () |
Returns true if the string is an Enigma command. More... | |
bool | IsEnigmaFont () |
Returns true if the string is an Enigma font command. More... | |
bool | IsEnigmaFileInfoTitle () |
Returns true if the string is an "Title" Enigma command. More... | |
bool | IsEnigmaFileInfoSubtitle () |
Returns true if the string is an "Subtitle" Enigma command. More... | |
bool | IsEnigmaFileInfoComposer () |
Returns true if the string is an "Composer" Enigma command. More... | |
bool | IsEnigmaFileInfoArranger () |
Returns true if the string is an "Arranger" Enigma command. More... | |
bool | IsEnigmaFileInfoLyricist () |
Returns true if the string is an "Lyricist" Enigma command. More... | |
bool | IsEnigmaFileInfoCopyright () |
Returns true if the string is an "Copyright" Enigma command. More... | |
bool | IsEnigmaTextInsert (bool only_file_info_inserts=true) |
Returns true if the string is an Enigma text command with a text insert. More... | |
bool | LoadResource (int resourceID, HINSTANCE dllinstance=0) |
Loads the resource string into the string object. More... | |
bool | MakeSubString (int startindex, int substringlength, FCString *pDestinationString) |
Creates a substring from the string. More... | |
bool | ReplaceCategoryFonts (FCCategoryDef *pCategoryDef, int fontmode, bool replacefonttag) |
Parses the raw string and changes all text tags according to a category definition. More... | |
void | SetCString (const char *pszBuffer, int maxchars=-1) |
Sets the string, using a C-string version of the string. More... | |
void | SetUTF8String (const char *pszBuffer) |
Sets the string, using a UTF8 C-style string. | |
void | SetCharacterAt (int index, eUniChar16 newcharacter) |
Sets the character at the index position. More... | |
void | SetUnicodeString (const eUniChar16 *pChar, int maxchars=-1) |
Sets the string by using a 16-bit Unicode buffer as input parameter. More... | |
void | SetInteger (int i) |
Sets the string to an integer. More... | |
void | SetHex (int number, int bitwidth) |
Sets the string to a lower-case hexadecimal number. More... | |
void | SetFloat (float f) |
Sets the string to a float. More... | |
void | SetMeasurement (float value, twobyte unit) |
Sets the string to an EVPU measurement value, formatted to a specific unit. More... | |
float | GetMeasurement (_ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) unit) |
Converts the string to an EVPU measurement value, based on a specific unit. More... | |
void | SetString (FCString *pString) |
Copies a string. More... | |
FCString * | CreateCopy () |
Creates a copy of the string object on the heap. More... | |
bool | SetCharacterUpperCase (int index) |
Sets a specific character to upper case. More... | |
void | SetCurrentTime () |
Set the string to the current time in hh:mm:ss format. More... | |
bool | Replace (const char *pszSource, const char *pszReplacement) |
Replaces a source pattern with a replacement string. More... | |
bool | EndsWith (const char *pszString) |
Returns true if the string ends with the parameter string. More... | |
bool | StartsWith (const char *pszString) |
Returns true if the string starts with the parameter string. More... | |
bool | StartsWithString (FCString *pString) |
Returns true if the string starts with the parameter string. More... | |
void | ToUnicode (eUniChar16 *pBuffer, int maxsize) |
Copies the string to a 16-bit Unicode string buffer. | |
void | ToLowerCase () |
Transforms the string to lower case. More... | |
void | ToUpperCase () |
Transforms the string to upper case. More... | |
bool | TrimEnigmaTags () |
Removes all Enigma tag information from a string, leaving only the actual text. More... | |
bool | TrimEnigmaFontTags () |
Removes all Enigma font tags from a string, leaving only the actual text and text insert tags, etc. More... | |
void | TrimWhitespace () |
Trims whitespace at both ends of the string. More... | |
void | TrimLinefeed () |
Trims linefeed characters at both ends of the string. More... | |
bool | TruncateAt (int newlength) |
Truncates the string at the indicated position. More... | |
bool | TruncateEnd (int count) |
Truncates the end of the string by a specific number of characters. More... | |
void | TruncateWidth (int maxlength, int prefixchars) |
Truncates the string by removing the middle part and inserting '...' instead. More... | |
virtual void | DebugDump () |
Outputs the class data/information for debugging purposes. More... | |
Public Member Functions inherited from __FCBase | |
__FCBase () | |
The constructor. | |
virtual | ~__FCBase () |
Virtual destructor, so all inherited classes get the virtual destructor. More... | |
void | DebugMsgDigit (const char *pszPrefixText, int i) |
Creates a simple Message Box for debug purposes. The text appears with the extra digit (in decimal presentation) appearing afterwards. More... | |
void | DebugMsgHex (const char *pszPrefixText, int i) |
Creates a simple Message Box for debug purposes. The text appears with the extra digit (as a hexadecimal number) appearing afterwards. More... | |
void | DebugMsgString (const char *pszPrefixText, const char *thestring) |
Creates a simple Message Box for debug purposes. The text appears with the extra string appearing afterwards. More... | |
void | DebugMsg (const char *pszMsg) |
Creates a simple Message Box for debug purposes with just one text string. More... | |
void | DebugOutMenuInfo (FCUI *pUI, int menuixd_horiz, int menuixd_vert) const |
Outputs the menu command info for debugging purposes. More... | |
int | DebugOutFormat (const char *fmt,...) |
Outputs debug text using C style "printf" syntax. More... | |
virtual void | DebugDataDump () |
Outputs a memory dump of the data block in the object for debugging purposes. More... | |
virtual void | DebugDataByteArrayDump () |
Outputs a memory dump of the data block in the object for debugging purposes, as a C++ byte array. More... | |
void | Set16BitFlag (FLAG_16 *flag, FLAG_16 flagbits, bool state) |
Sets a 16 bit flag in the data block. More... | |
void | Set32BitFlag (FLAG_32 *flag, FLAG_32 flagbits, bool state) |
Sets a 32 bit flag in the data block. More... | |
bool | GetBitFlag (FLAG_32 flag, FLAG_32 flagbits) const |
Gets a state from flag bits. Returns true if any bit in the mask is set. More... | |
void | SetUserData (void *pData) |
Sets the user data attached to the instance of an object. More... | |
void | SetUserData2 (void *pData) |
Sets the additional user data attached to the instance of an object. More... | |
void * | GetUserData () const |
Gets the user data attached to the instance of an object. More... | |
void * | GetUserData2 () const |
Gets the additional user data attached to the instance of an object. More... | |
virtual bool | IsIdentical (__FCBase *pCompareObject) |
Returns true if the data in the passed object is considered to be identical to the current object, otherwise false. More... | |
void | StoreXML_String (tinyxml2::XMLElement *pParentNode, const char *pszElementName, FCString *pStringValue) |
Helper function to store FCString objects in the XML file. More... | |
void | StoreXML_Integer (tinyxml2::XMLElement *pParentNode, const char *pszElementName, int value) |
Helper function to store integer objects in the XML file. More... | |
void | StoreXML_Bool (tinyxml2::XMLElement *pParentNode, const char *pszElementName, bool value) |
Helper function to store boolean objects in the XML file. More... | |
void | StoreXML_StringAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, FCString *pStringValue) |
Helper function to store FCString objects in the XML file, as an attribute to a node. More... | |
void | StoreXML_IntegerAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, int value) |
Helper function to store integer objects in the XML file, as an attribute to a node. More... | |
void | StoreXML_BoolAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, bool value) |
Helper function to store boolean objects in the XML file, as an attribute to a node. More... | |
void | StoreXML_FloatAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, float value) |
Helper function to store floating point objects in the XML file, as an attribute to a node. More... | |
bool | ReadXML_String (tinyxml2::XMLElement *pParentNode, const char *pszElementName, FCString *pStringValue) |
Helper method to read FCString objects from the XML file. More... | |
bool | ReadXML_Integer (tinyxml2::XMLElement *pParentNode, const char *pszElementName, int *pValue) |
Helper method to read integer objects from the XML file. More... | |
bool | ReadXML_Bool (tinyxml2::XMLElement *pParentNode, const char *pszElementName, bool *pValue) |
Helper method to read boolean objects from the XML file. More... | |
bool | ReadXML_StringAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, FCString *pStringValue) |
Helper method to read FCString objects from the XML file, as an attribute to a node. More... | |
bool | ReadXML_IntegerAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, int *pValue) |
Helper method to read integer objects from the XML file, as an attribute to a node. More... | |
bool | ReadXML_BoolAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, bool *pValue) |
Helper method to read boolean objects from the XML file, as an attribute to a node. More... | |
bool | ReadXML_FloatAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, float *pValue) |
Helper method to read floating point objects from the XML file, as an attribute to a node. More... | |
Static Public Attributes | |
static const eUniChar16 | emptyUniCharStr [] = { '\0' } |
Additional Inherited Members | |
Public Types inherited from __FCBase | |
enum | PDKFRAMEWORK_CLASSID { FCID_UNKNOWN = 0, FCID_ACCIDENTALMOD, FCID_ALLOTMENT, FCID_ARTICULATION, FCID_ARTICULATIONDEF, FCID_BACKWARDREPEAT, FCID_BASELINE, FCID_BEAMMOD, FCID_BEATCHARTELEMENT, FCID_BROKENBEAMMOD, FCID_CATEGORYDEF, FCID_CELLCLEFCHANGE, FCID_CELLFRAMEHOLD, FCID_CELLGRAPHIC, FCID_CELLTEXT, FCID_CENTERSMARTSHAPE, FCID_CHORD, FCID_CHORDPREFS, FCID_CHORDSUFFIXELEMENT, FCID_CHORUSSYLLABLE, FCID_CLEFDEF, FCID_COMPOSITETIMESIGBOTTOMELEMENT, FCID_COMPOSITETIMESIGTOPELEMENT, FCID_CROSSSTAFFMOD, FCID_CUSTOMSMARTLINEDEF, FCID_CUSTOMSTEMMOD, FCID_DISTANCEPREFS, FCID_DOTMOD, FCID_ENCLOSURE, FCID_ENDINGREPEAT, FCID_ENTRYALTERMOD, FCID_EXECUTABLESHAPEDEF, FCID_EXPRESSION, FCID_FONTINFO, FCID_FONTPREFS, FCID_FREEZESYSTEM, FCID_FRETBOARDSTYLEDEF, FCID_FRETBOARDSTYLEDEFS, FCID_FRETBOARDGROUPDEF, FCID_FRETBOARDGROUPDEFS, FCID_FRETINSTRUMENTDEF, FCID_GENERALPREFS, FCID_GRIDSGUIDESPREFS, FCID_GROUP, FCID_GROUPNAMEPOSITIONPREFS, FCID_HUMANPLAYBACKPREFS, FCID_INDEPENDENTCELLDETAIL, FCID_INSTRUMENTDEF, FCID_INSTRUMENTPLAYBACKDATA, FCID_KEYSIGNATURE, FCID_LAYERPREFS, FCID_LYRICSPREFS, FCID_MEASURE, FCID_MEASURENUMBERREGION, FCID_METATOOLASSIGNMENT, FCID_MIDIEXPRESSION, FCID_MISCDOCPREFS, FCID_MULTIMEASUREREST, FCID_MULTIMEASURERESTPREFS, FCID_MULTISTAFFINSTRUMENT, FCID_MULTISTAFFINSTRUMENTS, FCID_MUSICCHARACTERPREFS, FCID_MUSICSPACINGPREFS, FCID_NUMBER, FCID_NOTEHEADMOD, FCID_OTHERINCI, FCID_PERCUSSIONLAYOUTNOTE, FCID_PERCUSSIONSTAFF, FCID_PERFORMANCEMOD, FCID_PAGE, FCID_PAGEFORMATPREFS, FCID_PAGEGRAPHIC, FCID_PAGETEXT, FCID_PART, FCID_PARTEXTRACTPREFS, FCID_PARTSCOPEPREFS, FCID_PERCUSSIONNOTEMOD, FCID_PIANOBRACEPREFS, FCID_PLAYBACKPREFS, FCID_RAWTEXT, FCID_REPEATPREFS, FCID_SECONDARYBEAMBREAKMOD, FCID_SECTIONSYLLABLE, FCID_SEPARATEMEASURENUMBER, FCID_SEPARATEPLACEMENT, FCID_SHAPEDEF, FCID_SHAPEEXPRESSIONDEF, FCID_SLURCONTOURPREFS, FCID_SIZEPREFS, FCID_SMARTSHAPE, FCID_SMARTSHAPEENTRYMARK, FCID_SMARTSHAPEMEASUREMARK, FCID_SMARTSHAPEPREFS, FCID_STAFF, FCID_STAFFLIST, FCID_STAFFNAMEPOSITION, FCID_STAFFNAMEPOSITIONPREFS, FCID_STAFFSTYLEASSIGN, FCID_STAFFSTYLEDEF, FCID_STAFFSYSTEM, FCID_STEMCONNECTIONTABLE, FCID_STEMMOD, FCID_STRING, FCID_SYLLABLEENTRYMOD, FCID_SYSTEMSTAFF, FCID_TABLATURENOTEMOD, FCID_TEMPOELEMENT, FCID_TEXTBLOCK, FCID_TEXTEXPRESSIONDEF, FCID_TEXTREPEAT, FCID_TEXTREPEATDEF, FCID_TIEMOD, FCID_TIEPREFS, FCID_TIECONTOURPREFS, FCID_TIEPLACEMENTPREFS, FCID_TIMESIGNATURE, FCID_TUPLET, FCID_TUPLETPREFS, FCID_VERSESYLLABLE } |
Constants for the GetClassID method. More... | |
enum | MEASUREMENTUNITS { MEASUREMENTUNIT_DEFAULT = UNIT_DEFAULT, MEASUREMENTUNIT_EVPUS = UNIT_EVPUS, MEASUREMENTUNIT_INCHES = UNIT_INCHES, MEASUREMENTUNIT_CENTIMETERS = UNIT_CENTS, MEASUREMENTUNIT_POINTS = UNIT_POINTS, MEASUREMENTUNIT_PICAS = UNIT_PICAS, MEASUREMENTUNIT_SPACES = UNIT_SPACES, MEASUREMENTUNIT_MILLIMETERS = 100 } |
Constants for Finale's standard measurement units. More... | |
Static Public Member Functions inherited from __FCBase | |
static void | DebugOutPtr (const char *pszPrefixText, void *ptr) |
Static method that outputs a line for debugging purposes. The prefix text appears with the extra ptr (in hexadeximal representation) appearing afterwards. More... | |
static void | DebugOutDigit (const char *pszPrefixText, int i) |
Static method that outputs a line for debugging purposes. The text appears with the extra digit (in decimal presentation) appearing afterwards. More... | |
static void | DebugOutFloat (const char *pszPrefixText, float f) |
Static method that outputs a line for debugging purposes. The text appears with the extra float value appearing afterwards. More... | |
static void | DebugOutTag (const char *pszPrefixText, EXTAG extag) |
Static method that outputs a line for debugging purposes. The text appears with the EXTAG (in text) appearing afterwards. More... | |
static void | DebugOutHex (const char *pszPrefixText, int i) |
Static method that outputs a line for debugging purposes. The text appears with the extra digit (in hexadecimal presentation) appearing afterwards. More... | |
static void | DebugOutBin (const char *pszPrefixText, int i) |
Static method that outputs a line for debugging purposes. The text appears with the extra digit (in binary presentation) appearing afterwards. More... | |
static void | DebugOutString (const char *pszPrefixText, const char *thestring) |
Static method that outputs a line for debugging purposes (C string version). The text appears with the extra string appearing afterwards. More... | |
static void | DebugOutString (const char *pszPrefixText, FCString *pString) |
Static method that outputs a line for debugging purposes (FCString version). The text appears with the extra string appearing afterwards. More... | |
static void | DebugOutBool (const char *pszPrefixText, bool state) |
Static method that outputs a line for debugging purposes. The boolean state appears afterwards as either "TRUE" or "FALSE". More... | |
static void | DebugOutBlock (const void *pBuffer, int startoffset, int size) |
Static method that outputs a memory block for debugging purposes. Eight bytes per line will appear (as hex digits) until the whole memory block is dumped. More... | |
static void | DebugOutByteArrayBlock (const void *pBuffer, int startoffset, int size) |
Static method that outputs a memory block for debugging purposes. Eight bytes per line will appear (as hex digits) as a C++ onebyte array, until the whole memory block is dumped. More... | |
static void | DebugOut (const char *pszLine) |
Static method to output a line of text for debugging purposes. More... | |
Class that provides storage for text. This is to achieve platform-transparent text handling, that can handle text storage regardless of how it's done on the platform (Mac/Window/C-style/Unicode/etc).
When running on Finale 2012 and above, the FCString stores the strings as UTF16 internally.
For Finale 2011 and below, the FCString is handled as a 8-bit arrays (meaning that any foreign characters would be platform specific).
06 September 2013: a major redesign of this class to make it work better with Lua. No overloaded methods anymore (Append, Contains, etc). Instead, a suffix with the type is used ("AppendCString" etc).
|
inline |
The constructor. Defauls to an empty string.
Lua-supported.
void FCString::_SetCFURLRefPath | ( | void * | cfurl | ) |
For internal use only. Converts a CFURLRef to a file path.
void FCString::AppendCharacter | ( | eUniChar16 | character | ) |
Appends a character to the string.
Lua-supported.
void FCString::AppendCString | ( | const char * | pOtherString | ) |
Appends a C-style string to the string.
For JW Lua, use #AppendLuaString() instead.
|
inline |
Appends a system-specific end-of-line string to the to the FCString object.
Lua-supported.
void FCString::AppendFloat | ( | float | value | ) |
Appends an floating-point value to the string.
Lua-supported.
void FCString::AppendInteger | ( | int | value | ) |
Appends an integer value (decimal) to the string.
Lua-supported.
void FCString::AppendString | ( | FCString * | pOtherString | ) |
Appends another string object to the string.
Lua-supported.
|
inline |
Makes sure that the string ends with a path delimiter (backslash or slash, depending on OS). The method will not add any delimiter to empty strings.
Lua-supported.
|
inline |
Returns the first position where a substring occurs. C-string version.
Lua-supported (as "CalcLuaStringPos").
|
inline |
Returns the first position where a substring occurs, from a starting point. C-string version.
Lua-supported (as "CalcLuaStringPosFrom").
|
inline |
Returns the first position where a substring occurs.
Lua-supported.
int FCString::CalcStringPosFrom | ( | FCString * | pSubString, |
int | startindex | ||
) |
Returns the first position where a substring occurs, from a starting point.
Lua-supported.
|
inlinevirtual |
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child class.
Lua-supported.
Reimplemented from __FCBase.
|
inline |
Creates an empty string.
Lua-supported.
|
inline |
Compares string against another string.
Lua-supported.
|
inline |
Case insensitive version of Compare.
Lua-supported.
|
inline |
Returns true if the substring is found within the string. C-string version.
Lua-supported (as "ContainsLuaString").
|
inline |
Returns true if the substring is found from a certain position within the string. C-string version.
Lua-supported (as "ContainsLuaStringFrom").
bool FCString::ContainsEnigmaTextInsert | ( | bool | only_file_info_inserts = true | ) |
Returns true if the text block contains a text insert.
Lua-supported.
only_file_info_inserts | If set, the method will only return true if a text insert from the "File Info" is found in the string. |
bool FCString::ContainsString | ( | FCString * | pSubString | ) |
Returns true if the substring is found within the string.
Lua-supported.
bool FCString::ContainsStringFrom | ( | FCString * | pSubString, |
int | startindex | ||
) |
Returns true if the substring is found within the string from a certain position.
Lua-supported.
bool FCString::CopyToUnicodeBuffer | ( | eUniChar16 * | pBuffer, |
int | maxbufferlen = 0 |
||
) | const |
Copies the string to a 16-bit Unicode buffer. The buffer must be big enough to have room for an ending 0.
pBuffer | Pointer to the 16-bit character buffer. |
maxbufferlen | Max number of 16-bit elements in the input buffer. 0 (the default) means the string is copied to the buffer without any range checking. |
FCString * FCString::CreateCopy | ( | ) |
Creates a copy of the string object on the heap.
It's the caller's responsibility to delete it from the heap after use.
FCStrings * FCString::CreateEnigmaComponents | ( | ) |
Creates a string collection that consists of the components from an Enigma text command (with correct syntax).
It's the callers responsibility to make sure that the string really is a fully qualified Enigma string command.
Lua-supported.
FCStrings * FCString::CreateEnigmaStrings | ( | bool | include_non_commands = false | ) |
Creates a string collection of every enigma text tag found in the string.
The first Enigma tag found is at index position 0, the next at position 1, and so on.
Lua-supported.
include_non_commands | If set, the actual text in the raw string is also added as separate strings in the collection. |
FCFontInfo * FCString::CreateLastFontInfo | ( | ) |
Creates a FCFontInfo object with the last font information (based on the Enigma text tags) found in the string.
Lua-supported.
FCStrings * FCString::CreateParsedStrings | ( | const char * | pszSeparators | ) |
Creates a collection of strings based on the separator characters. C-style string version.
The separators are never in the substrings. Each substring contains the text between separators.
Lua-supported.
pszSeparators | A string containing all the separators. |
FCStrings * FCString::CreateRows | ( | ) |
brief Creates a collection of strings based on the newline or line feed characters.
This method support any combination of the 3 common line break methods.
Lua-supported.
|
inlinevirtual |
Outputs the class data/information for debugging purposes.
Accessible if PDK_FRAMEWORK_DEBUG is defined.
When child class inherit this method to output the contents of its own members, it should call the parent before providing its own output.
Reimplemented from __FCBase.
bool FCString::DeleteCharacterAt | ( | int | index | ) |
Removes a character at the 0-based index position.
Lua-supported.
index | The 0-based position in the string. -1 means the last character in the string. |
bool FCString::DeleteCharactersAt | ( | int | index, |
int | count | ||
) |
Removes a range of characters, starting at the 0-based index position.
Lua-supported.
index | The 0-based character index position in the string. |
count | Number of characters to remove. |
bool FCString::EndsWith | ( | const char * | pszString | ) |
Returns true if the string ends with the parameter string.
C string version
|
inline |
Removes everything except the file extension part of a file name.
If there is no file extension, an empty name is returned.
Lua-supported.
|
inline |
Returns the 0-based index for the first occurence of the substring.
Lua-supported.
pszSubStr | The substring in C-string format. |
|
inline |
Returns the 0-based index for the first occurence of the substring.
Lua-supported.
pszSubStr | The substring in C-string format. |
void FCString::FormatCharacterNumber | ( | eUniChar16 | character | ) |
Formats a 16-bit character (symbol) number to a string for presentation purposes.
For character numbers between 0 and 255, the string will become a decimal text version of the character number. For characters above 255, the Unicode U+FFFF hexadecimal format will be used.
Lua-supported.
character | The number of the character. Please note that only the 16-bit character range is supported. |
int FCString::FormatCString | ( | const char * | fmt, |
... | |||
) |
Formats a string using the same syntax and manner as the printf() function in C. The version of the method doesn't supports Unicode.
Requires the PDK_FRAMEWORK_FORMAT define.
fmt | A format string (C style). Additional parameters follow according to syntax of the format string. |
int FCString::FormatString | ( | FCString * | fmt, |
... | |||
) |
Formats a string using the same syntax and manner as the printf() function in C. The version of the method supports Unicode on Finale 2012 and later.
Requires the PDK_FRAMEWORK_FORMAT define.
fmt | A format string (using a FCString object). Additional parameters follow according to syntax of the format string. |
eUniChar16 FCString::GetCharacterAt | ( | int | index | ) |
Returns the character at the index position.
Lua-supported.
index | The 0-based index position in the string. -1 means the last character in the string. |
|
inlinevirtual |
Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has problems to resolve the true classes of inherited objects.
This method must be overwritten by all child classes.
Lua-supported.
Reimplemented from __FCBase.
const char * FCString::GetCString | ( | ) | const |
Returns a C-string version of the string.
const char * FCString::GetEOL | ( | ) | const |
Returns the platform-specific end-of-line character(s) as a C-string.
On Windows, it returns carriage return+new line. On OS X, it returns new line.
Lua-supported (also as read-only property)
float FCString::GetFloat | ( | int | index = 0 | ) |
Converts the decimal string contents to a float value.
This method supports both "." and "," as the decimal point.
Lua-supported.
index | Optional index start position in the string. |
int FCString::GetHex | ( | ) |
Converts the unsigned hexadecimal string to an integer value. The string can only contain valid hexadecimal characters.
Lua-supported.
int FCString::GetInteger | ( | int | index = 0 | ) |
Converts the decimal string contents to an integer value.
Lua-supported.
index | Optional index start position in the string. |
|
inline |
Returns the length of the string.
Lua-supported.
float FCString::GetMeasurement | ( | _ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) | unit | ) |
Converts the string to an EVPU measurement value, based on a specific unit.
In C++, PDK_FRAMEWORK_PREFS must be defined to enable this method.
Lua-supported.
unit | Any of the MEASUREMENTUNIT_ constants, such as MEASUREMENTUNIT_DEFAULT. |
void * FCString::GetNSString | ( | ) |
Returns a NSString* version of the string (on Cocoa only).
The returned NSString* object should NOT be released - it's retained/released with the object.
Each time this method is referenced, a new object is created and the old object is released.
void FCString::Insert | ( | const char * | pszString, |
int | insertindex = 0 |
||
) |
Inserts a C string to the string at a specified index position.
Lua-supported.
pszString | C string to insert. |
insertindex | 0-based position where the string should be inserted. |
void FCString::InsertString | ( | FCString * | pString, |
int | insertindex = 0 |
||
) |
Inserts a string object to the string at a specified index position.
pString | String object to insert. |
insertindex | 0-based position where the string should be inserted. |
bool FCString::IsAllDigits | ( | ) |
Returns true if all characters in the string are digits (0 through 9).
Lua-supported.
bool FCString::IsCharacter | ( | int | index, |
eUniChar16 | character | ||
) |
Returns true if the character at the index matches the supplied character.
Lua-supported.
index | The 0-based index to the position in the string. This method is "index safe", so if the index is out of range false will be returned. |
character | The character to check for match. |
bool FCString::IsCharacters | ( | int | index, |
const char * | pChars | ||
) |
Returns true if the character at the index matches any of the supplied character.
Lua-supported.
index | The 0-based index to the position in the string. This method is "index safe", so if the index is out of range false will be returned. |
pChars | The pointer to the C-style string with characters to check for match. |
bool FCString::IsDigit | ( | int | index | ) |
Returns true if the character at the specified 0-based index position is a digit (0 through 9).
Lua-supported.
index | The 0-based index. -1 means last character in string. |
|
inline |
Returns true if the string is empty.
Lua-supported.
|
inline |
Returns true if the string is an Enigma command.
Lua-supported.
bool FCString::IsEnigmaFileInfoArranger | ( | ) |
Returns true if the string is an "Arranger" Enigma command.
Lua-supported.
bool FCString::IsEnigmaFileInfoComposer | ( | ) |
Returns true if the string is an "Composer" Enigma command.
Lua-supported.
bool FCString::IsEnigmaFileInfoCopyright | ( | ) |
Returns true if the string is an "Copyright" Enigma command.
Lua-supported.
bool FCString::IsEnigmaFileInfoLyricist | ( | ) |
Returns true if the string is an "Lyricist" Enigma command.
Lua-supported.
bool FCString::IsEnigmaFileInfoSubtitle | ( | ) |
Returns true if the string is an "Subtitle" Enigma command.
Lua-supported.
bool FCString::IsEnigmaFileInfoTitle | ( | ) |
Returns true if the string is an "Title" Enigma command.
Lua-supported.
bool FCString::IsEnigmaFont | ( | ) |
Returns true if the string is an Enigma font command.
Lua-supported.
bool FCString::IsEnigmaTextInsert | ( | bool | only_file_info_inserts = true | ) |
Returns true if the string is an Enigma text command with a text insert.
Lua-supported.
|
inline |
Returns true if the string is identical with the parameter.
The C string version is considered to be the "standard" method in this particular case.
Lua-supported.
bool FCString::IsEqualString | ( | FCString * | pString | ) |
Returns true if the string is identical with the parameter. (FCString string version.)
Lua-supported.
bool FCString::IsNumber | ( | ) |
Returns true if the string is a number.
The syntax requirements are:
Lua-supported.
bool FCString::IsWhitespace | ( | int | index | ) |
Returns true if the character position contains a whitespace.
Lua-supported.
bool FCString::LoadResource | ( | int | resourceID, |
HINSTANCE | dllinstance = 0 |
||
) |
Loads the resource string into the string object.
resourceID | The resource ID. On Windows, it's the resource number. On the Mac, it's the localization string in the .strings file. |
pszResourceFileName | Mac only The optional C string pointer to the resource file name. This defaults to NULL, which means that the previous resource should be used. The first call to this method must contain a valid resource file name. If strings should be loaded from the plug-in's resource on Windows, the resource file string should be the same as the plug-in binary name, using a syntax such as myplugin.fxt. On the Mac, it's the string for the bundle ID of the plug-in. |
pszTableName | Mac only. The optional table name within the bundle, which is the .strings file without extension. This defaults to NULL, which means the table name that has been set in earlier calls will be used. |
dllinstance | Windows only The DLL instance handle to the plug-in (where the resources are located). |
bool FCString::MakeSubString | ( | int | startindex, |
int | substringlength, | ||
FCString * | pDestinationString | ||
) |
Creates a substring from the string.
Lua-supported.
startindex | The 0-based index where the string should start. |
substringlength | The length. If the length extends beyond the source string, the substring will end at that point. |
pDestinationString | The destination string where the result will be put. It can be the same as the source object. |
bool FCString::Replace | ( | const char * | pszSource, |
const char * | pszReplacement | ||
) |
Replaces a source pattern with a replacement string.
Lua-supported.
pszSource | The source string in C-string format. |
pszReplacement | The replacement in C-string format. |
bool FCString::ReplaceCategoryFonts | ( | FCCategoryDef * | pCategoryDef, |
int | fontmode, | ||
bool | replacefonttag | ||
) |
Parses the raw string and changes all text tags according to a category definition.
The category tags are changed according to this:
The tags are case sensitive.
The PDK_FRAMEWORK_ENIGMASTRINGS define must be declared for this method to compile.
pCategoryDef | Pointer to the category definition object. |
fontmode | Any of the CATEGORYMODE_ constants, found in the FCCategoryDef class. If set to anything else than CATEGORYMODE_NONE, the fonts ^font tag will be replaced with the font of the category type. |
replacefonttag | Only used if the fontmode parameter is set to to something other than CATEGORYMODE_NONE. If true, the ^font tag will be replaced with category's Enigma tag (such as ^fontMus, ^fontTxt, ^fontNum). In false, the ^font tag will still be used. |
|
inline |
Sets the path string to Finale's auto-save folder.
On the Mac, the string is in POSIX format.
|
inline |
Sets the path string to Finale's backup folder.
On the Mac, the string is in POSIX format.
void FCString::SetCharacterAt | ( | int | index, |
eUniChar16 | newcharacter | ||
) |
Sets the character at the index position.
Lua-supported.
index | The 0-based index position in the string. |
newcharacter | The character to e put at the index position. |
bool FCString::SetCharacterUpperCase | ( | int | index | ) |
Sets a specific character to upper case.
When running on Finale 2012 and above, this method supports Unicode.
Lua-supported.
index | The 0-based index within the string. |
void FCString::SetCString | ( | const char * | pszBuffer, |
int | maxchars = -1 |
||
) |
Sets the string, using a C-string version of the string.
pszBuffer | Pointer to a C-string character buffer. If it's NULL, an empty string will be created. |
maxchars | Maximum number of characters. The default is -1, meaning a NULL-terminated string of any length. |
|
inline |
Set the string to the current time in hh:mm:ss format.
Lua-supported.
|
inline |
Sets the path string to Finale's document styles folder.
On the Mac, the string is in POSIX format.
void FCString::SetFloat | ( | float | f | ) |
Sets the string to a float.
|
inline |
Sets the path string to Finale's font annotation folder.
On the Mac, the string is in POSIX format.
void FCString::SetHex | ( | int | number, |
int | bitwidth | ||
) |
Sets the string to a lower-case hexadecimal number.
Lua-supported.
number | The number that should be converted to a hexadeximal value. |
bitwidth | The bit width of output string. The values 8, 16, 32, 64 are valid as bit width specifiers. Use 0 to not pad the number to a specified bit width. |
void FCString::SetInteger | ( | int | i | ) |
Sets the string to an integer.
Lua-supported.
|
inline |
Sets the path string to Finale's library folder.
On the Mac, the string is in POSIX format.
void FCString::SetMeasurement | ( | float | value, |
twobyte | unit | ||
) |
Sets the string to an EVPU measurement value, formatted to a specific unit.
In C++, PDK_FRAMEWORK_PREFS must be defined to enable this method.
Lua-supported.
value | The value in EVPUs. The measurement can be using decimals. |
unit | Any of the MEASUREMENTUNIT_ constants, such as MEASUREMENTUNIT_DEFAULT. |
|
inline |
Sets the path string to Finale's music folder.
On the Mac, the string is in POSIX format.
|
inline |
Sets the full path string to Finale's percussion note types text file. This file should NEVER be modified, only read from it.
On the Mac, the file path string is in POSIX format.
|
inline |
Sets the path string to Finale's root plug-in folder.
On the Mac, the string is in POSIX format.
|
inline |
Sets the path string to Finale's preference folder.
On the Mac, the string is in POSIX format.
void FCString::SetRunningLuaFilePath | ( | ) |
Sets the string to the folder for the running script file. The string is cleared if the script is run without a file. Only available for JW Lua.
Please note that this method always sets to the main script file. Calling the method from any sub scripts (using "require" or similar) will still point to the main script file.
Lua-supported.
void FCString::SetRunningLuaFolderPath | ( | ) |
Sets the string to the folder for the running script file. The string is cleared if the script is run without a file. Only available for JW Lua.
Lua-supported.
void FCString::SetString | ( | FCString * | pString | ) |
|
inline |
Sets the path string to Finale's temp folder (for temporary files).
On the Mac, the string is in POSIX format.
|
inline |
Sets the path string to Finale's template folder.
On the Mac, the string is in POSIX format.
void FCString::SetUnicodeString | ( | const eUniChar16 * | pChar, |
int | maxchars = -1 |
||
) |
Sets the string by using a 16-bit Unicode buffer as input parameter.
[in] | pChar | The Unicode buffer to copy from. |
[in] | maxchars | The maximum characters to copy. -1 (the default) means that it's NULL-terminated of any length. |
void FCString::SetUserOptionsPath | ( | ) |
Sets the string to the user options path on the running system.
On Windows, this typically is Username/Roaming. On OSX, it's usually ~/Library/Preferences.
Lua-supported.
|
inline |
Splits a string into 2 substrings at a specific split point character position.
Lua-supported.
splitpointindex | The 0-based index position where the split should be. This cannot be at a position that extends beyond the string length. |
pFirstString | Pointer to the FCString object that should contain the first substring, before the splitpoint. Can be NULL if the substring isn't needed. It cannot be identical to the calling object, if both substring objects are used. Also, it can't identical to the second string. |
pSecondString | Pointer to the FCString object that should contain the first substring, after the splitpoint. Can be NULL if it isn't needed. It cannot be identical to the calling object, if both substring objects are used. Also, it can't identical to the first string. |
includesplitposchar | true - include the character at the split position as the ending character of the first substring. false - don't include the character at the split position. |
Splits a fully qualified file path into path part and file part copies.
On the Mac, this has to be a POSIX string.
Lua-supported.
pPathPart | Pointer to the object that should contain the path. Can be NULL if it isn't needed. |
pFilePart | Pointer to the object that should contain the path. Can be NULL if it isn't needed. |
bool FCString::StartsWith | ( | const char * | pszString | ) |
Returns true if the string starts with the parameter string.
C string version (which is the "default" version in this case).
Lua-supported.
bool FCString::StartsWithString | ( | FCString * | pString | ) |
void FCString::ToLowerCase | ( | ) |
Transforms the string to lower case.
When running on Finale 2012 and above, this method supports Unicode.
Lua-supported.
void FCString::ToUpperCase | ( | ) |
Transforms the string to upper case.
When running on Finale 2012 and above, this method supports Unicode.
Lua-supported.
bool FCString::TrimEnigmaFontTags | ( | ) |
Removes all Enigma font tags from a string, leaving only the actual text and text insert tags, etc.
These tags are removed:
Lua-supported.
bool FCString::TrimEnigmaTags | ( | ) |
Removes all Enigma tag information from a string, leaving only the actual text.
Lua-supported.
void FCString::TrimLinefeed | ( | ) |
Trims linefeed characters at both ends of the string.
Both CR and LF are trimmed. Other whitespace is not trimmed.
Lua-supported.
void FCString::TrimWhitespace | ( | ) |
Trims whitespace at both ends of the string.
Space, Tab, CR and LF are trimmed
Lua-supported.
|
inline |
Truncates the string at the indicated position.
Lua-supported.
[in] | newlength | The new length of the string. |
|
inline |
Truncates the end of the string by a specific number of characters.
Lua-supported.
[in] | count | The number of characters that should be removed from the end of the string. |
|
inline |
Truncates the string by removing the middle part and inserting '...' instead.
Lua-supported.