Finale PDK Framework  0.54
Public Member Functions | Static Public Attributes | List of all members
FCString Class Reference

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>

Inheritance diagram for FCString:
__FCBase

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...
 
FCStringsCreateEnigmaComponents ()
 Creates a string collection that consists of the components from an Enigma text command (with correct syntax). More...
 
FCStringsCreateEnigmaStrings (bool include_non_commands=false)
 Creates a string collection of every enigma text tag found in the string. More...
 
FCFontInfoCreateLastFontInfo ()
 Creates a FCFontInfo object with the last font information (based on the Enigma text tags) found in the string. More...
 
FCStringsCreateParsedStrings (const char *pszSeparators)
 Creates a collection of strings based on the separator characters. C-style string version. More...
 
FCStringsCreateRows ()
 
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...
 
FCStringCreateCopy ()
 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...
 

Detailed Description

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).

Constructor & Destructor Documentation

FCString::FCString ( )
inline

The constructor. Defauls to an empty string.

Lua-supported.

Member Function Documentation

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.

void FCString::AppendEOL ( )
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.

void FCString::AssureEndingPathDelimiter ( )
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.

int FCString::CalcCStringPos ( FCString pSubString,
const char *  pszSubString 
)
inline

Returns the first position where a substring occurs. C-string version.

Lua-supported (as "CalcLuaStringPos").

Returns
-1 if the substring isn't found. Otherwise, the 0-based position where the substring is found.
int FCString::CalcCStringPosFrom ( const char *  pszSubString,
int  startindex 
)
inline

Returns the first position where a substring occurs, from a starting point. C-string version.

Lua-supported (as "CalcLuaStringPosFrom").

Returns
-1 if the substring isn't found. Otherwise, the 0-based position where the substring is found.
int FCString::CalcStringPos ( FCString pSubString)
inline

Returns the first position where a substring occurs.

Lua-supported.

Returns
-1 if the substring isn't found. Otherwise, the 0-based position where the substring is found.
int FCString::CalcStringPosFrom ( FCString pSubString,
int  startindex 
)

Returns the first position where a substring occurs, from a starting point.

Lua-supported.

Returns
-1 if the substring isn't found. Otherwise, the 0-based position where the substring is found.
virtual const char* FCString::ClassName ( )
inlinevirtual

Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child class.

Lua-supported.

Reimplemented from __FCBase.

void FCString::Clear ( )
inline

Creates an empty string.

Lua-supported.

int FCString::Compare ( FCString pString2)
inline

Compares string against another string.

Lua-supported.

Returns
Less than 0 if the string is less than the compared string. 0 if the string is equal to the compared string. Above 0 if the compared string is less.
int FCString::CompareNoCase ( FCString pString2)
inline

Case insensitive version of Compare.

Lua-supported.

bool FCString::ContainsCString ( const char *  pszSubString)
inline

Returns true if the substring is found within the string. C-string version.

Lua-supported (as "ContainsLuaString").

bool FCString::ContainsCStringFrom ( const char *  pszSubString,
int  startindex 
)
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.

Parameters
only_file_info_insertsIf 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.

Parameters
pBufferPointer to the 16-bit character buffer.
maxbufferlenMax number of 16-bit elements in the input buffer. 0 (the default) means the string is copied to the buffer without any range checking.
Returns
True on success. False on parameter errors.
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.

Returns
NULL if the string isn't an Enigma string command. Otherwise, the string collection arranged like this:
  • The command (without the '^') is stored at index 0 of the string collection.
  • The parameters are stored at index 1 and above. The returned collection must be deleted from the heap after use.
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.

Parameters
include_non_commandsIf set, the actual text in the raw string is also added as separate strings in the collection.
Returns
Pointer to the created string collection. This must be deleted from the heap after use.
FCFontInfo * FCString::CreateLastFontInfo ( )

Creates a FCFontInfo object with the last font information (based on the Enigma text tags) found in the string.

Lua-supported.

Returns
Pointer to the created FCFontInfo object. This must be deleted from the heap after use.
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.

Parameters
pszSeparatorsA string containing all the separators.
Returns
A pointer to a FCStrings object, containing all the substrings. The pointer must be disposed by the caller after use.
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.

  • Returns
    A pointer to a FCStrings object, containing all the substrings. The pointer must be disposed by the caller after use.
virtual void FCString::DebugDump ( )
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.

Parameters
indexThe 0-based position in the string. -1 means the last character in the string.
Returns
True on success.
bool FCString::DeleteCharactersAt ( int  index,
int  count 
)

Removes a range of characters, starting at the 0-based index position.

Lua-supported.

Parameters
indexThe 0-based character index position in the string.
countNumber of characters to remove.
Returns
True on success.
bool FCString::EndsWith ( const char *  pszString)

Returns true if the string ends with the parameter string.

C string version

void FCString::ExtractFileExtension ( )
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.

int FCString::FindFirst ( const char *  pszSubStr)
inline

Returns the 0-based index for the first occurence of the substring.

Lua-supported.

Parameters
pszSubStrThe substring in C-string format.
Returns
-1 if not found. Otherwise, the 0-based index.
int FCString::FindLast ( const char *  pszSubStr)
inline

Returns the 0-based index for the first occurence of the substring.

Lua-supported.

Parameters
pszSubStrThe substring in C-string format.
Returns
-1 if not found. Otherwise, the 0-based index.
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.

Parameters
characterThe 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.

Parameters
fmtA 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.

Parameters
fmtA 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.

Parameters
indexThe 0-based index position in the string. -1 means the last character in the string.
Returns
The character found at the index position. 0 if the index position is out of range.
virtual const PDKFRAMEWORK_CLASSID FCString::GetClassID ( )
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.

Returns
Pointer to a C-string version of the string. This pointer is permanent until GetCString is called again, or until the string object is destroyed.
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.

Parameters
indexOptional index start position in the string.
Returns
The float value. 0 if the string isn't a decimal digit string or if the index is incorrect.
int FCString::GetHex ( )

Converts the unsigned hexadecimal string to an integer value. The string can only contain valid hexadecimal characters.

Lua-supported.

Returns
-1 if the string contains illegal characters. Otherwise a non-negative value.
int FCString::GetInteger ( int  index = 0)

Converts the decimal string contents to an integer value.

Lua-supported.

Parameters
indexOptional index start position in the string.
Returns
The integer value. 0 if the string isn't a decimal digit string or if the index is incorrect.
int FCString::GetLength ( ) const
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.

Parameters
unitAny of the MEASUREMENTUNIT_ constants, such as MEASUREMENTUNIT_DEFAULT.
Returns
0 on error. Otherwise, the value.
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.

Parameters
pszStringC string to insert.
insertindex0-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.

Parameters
pStringString object to insert.
insertindex0-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.

Parameters
indexThe 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.
characterThe character to check for match.
Returns
True if the character match at the position. False if the character doesn't match, or if the index is out of range.
bool FCString::IsCharacters ( int  index,
const char *  pChars 
)

Returns true if the character at the index matches any of the supplied character.

Lua-supported.

Parameters
indexThe 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.
pCharsThe pointer to the C-style string with characters to check for match.
Returns
True if any of the characters match at the position. False if the characters don't match, or if the index is out of range.
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.

Parameters
indexThe 0-based index. -1 means last character in string.
bool FCString::IsEmpty ( )
inline

Returns true if the string is empty.

Lua-supported.

bool FCString::IsEnigmaCommand ( )
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.

bool FCString::IsEqual ( const char *  pszString)
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:

  • String might start with a negative minus at the first position
  • String might consist of one decimal dot
  • The rest of the string must be digits

Lua-supported.

Returns
Empty strings returns false. Otherwise true, if the number syntax is correct.
bool FCString::IsWhitespace ( int  index)

Returns true if the character position contains a whitespace.

Lua-supported.

Returns
False on error (if index is out of range) or if the index position contains a non-whitespace.
bool FCString::LoadResource ( int  resourceID,
HINSTANCE  dllinstance = 0 
)

Loads the resource string into the string object.

Parameters
resourceIDThe resource ID. On Windows, it's the resource number. On the Mac, it's the localization string in the .strings file.
pszResourceFileNameMac 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.
pszTableNameMac 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.
dllinstanceWindows only The DLL instance handle to the plug-in (where the resources are located).
Returns
True if the resource was correctly loaded. If the resource string wasn't loaded, the string will contain "Resource String Error".
bool FCString::MakeSubString ( int  startindex,
int  substringlength,
FCString pDestinationString 
)

Creates a substring from the string.

Lua-supported.

Parameters
startindexThe 0-based index where the string should start.
substringlengthThe length. If the length extends beyond the source string, the substring will end at that point.
pDestinationStringThe destination string where the result will be put. It can be the same as the source object.
Returns
True on success.
bool FCString::Replace ( const char *  pszSource,
const char *  pszReplacement 
)

Replaces a source pattern with a replacement string.

Lua-supported.

Parameters
pszSourceThe source string in C-string format.
pszReplacementThe replacement in C-string format.
Returns
Returns true if replacements were made.
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:

  • ^font(Font0,0) tags are changed to the category's music font.
  • ^fontTxt tags are changed to the category's text font.
  • ^fontMus tags are changed to the category's music font.
  • ^fontNum tags are changed to the category's number font.

The tags are case sensitive.

The PDK_FRAMEWORK_ENIGMASTRINGS define must be declared for this method to compile.

Parameters
pCategoryDefPointer to the category definition object.
fontmodeAny 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.
replacefonttagOnly 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.
Returns
True if the string object has been changed. False if no changes were made. Please note that if the category object doesn't support a required font style, false will be returned.
void FCString::SetAutoSaveFolderPath ( )
inline

Sets the path string to Finale's auto-save folder.

On the Mac, the string is in POSIX format.

void FCString::SetBackupFolderPath ( )
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.

Parameters
indexThe 0-based index position in the string.
newcharacterThe 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.

Parameters
indexThe 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.

Parameters
pszBufferPointer to a C-string character buffer. If it's NULL, an empty string will be created.
maxcharsMaximum number of characters. The default is -1, meaning a NULL-terminated string of any length.
void FCString::SetCurrentTime ( )
inline

Set the string to the current time in hh:mm:ss format.

Lua-supported.

void FCString::SetDocStylesFolderPath ( )
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.

void FCString::SetFontAnnotationFolderPath ( )
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.

Parameters
numberThe number that should be converted to a hexadeximal value.
bitwidthThe 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.

void FCString::SetLibFolderPath ( )
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.

Parameters
valueThe value in EVPUs. The measurement can be using decimals.
unitAny of the MEASUREMENTUNIT_ constants, such as MEASUREMENTUNIT_DEFAULT.
void FCString::SetMusicFolderPath ( )
inline

Sets the path string to Finale's music folder.

On the Mac, the string is in POSIX format.

void FCString::SetPercussionTypesFilePath ( )
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.

void FCString::SetPluginsFolderPath ( )
inline

Sets the path string to Finale's root plug-in folder.

On the Mac, the string is in POSIX format.

void FCString::SetPreferencesFolderPath ( )
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)

Copies a string.

Lua-supported.

Parameters
pStringAnother string (of the FCString class).
void FCString::SetTempFolderPath ( )
inline

Sets the path string to Finale's temp folder (for temporary files).

On the Mac, the string is in POSIX format.

void FCString::SetTemplateFolderPath ( )
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.

Parameters
[in]pCharThe Unicode buffer to copy from.
[in]maxcharsThe 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.

bool FCString::SplitAt ( int  splitpointindex,
FCString pFirstString,
FCString pSecondString,
bool  includesplitposchar 
)
inline

Splits a string into 2 substrings at a specific split point character position.

Lua-supported.

Parameters
splitpointindexThe 0-based index position where the split should be. This cannot be at a position that extends beyond the string length.
pFirstStringPointer 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.
pSecondStringPointer 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.
includesplitposchartrue - 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.
Returns
True on success.
bool FCString::SplitToPathAndFile ( FCString pPathPart,
FCString pFilePart 
)
inline

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.

Parameters
pPathPartPointer to the object that should contain the path. Can be NULL if it isn't needed.
pFilePartPointer to the object that should contain the path. Can be NULL if it isn't needed.
Returns
true on success
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)

Returns true if the string starts with the parameter string.

FCString string version

Lua-supported.

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:

  • ^font
  • ^Font
  • ^fontMus
  • ^fontTxt
  • ^fontNum
  • ^nfx
  • ^size

Lua-supported.

Returns
True if any tags were removed. False if the string was untouched.
bool FCString::TrimEnigmaTags ( )

Removes all Enigma tag information from a string, leaving only the actual text.

Lua-supported.

Returns
True if any tags were removed. False if the string was untouched.
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.

bool FCString::TruncateAt ( int  newlength)
inline

Truncates the string at the indicated position.

Lua-supported.

Parameters
[in]newlengthThe new length of the string.
Returns
True on success. False if the string length already is small enough.
bool FCString::TruncateEnd ( int  count)
inline

Truncates the end of the string by a specific number of characters.

Lua-supported.

Parameters
[in]countThe number of characters that should be removed from the end of the string.
Returns
True on success. False on parameter error, or of the string is too short to be fully truncated.
void FCString::TruncateWidth ( int  maxlength,
int  prefixchars 
)
inline

Truncates the string by removing the middle part and inserting '...' instead.

Lua-supported.