8 #ifndef FF_BASECOLLECTION_H
9 #define FF_BASECOLLECTION_H
26 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
42 void _RequireElement(
int no_of_required_elements);
57 virtual const char*
ClassName() {
return "__FCCollection"; }
77 if (_pDataArray)
delete [] _pDataArray;
245 bool Swap(
int index1,
int index2)
247 if (index1 == index2)
return false;
248 if (index1 < 0 || index2 < 0)
return false;
249 if (index1 >= _counter || index2 >= _counter)
return false;
250 __FCBase* pObjectTemp = _pDataArray[index1];
251 _pDataArray[index1] = _pDataArray[index2];
252 _pDataArray[index2] = pObjectTemp;
273 while (pOtherCollection->
GetCount() > 0)
299 for (
int i = 0; i <
GetCount(); i++)
303 if (!pCurrent->
IsIdentical(pCompare))
return false;
308 #ifdef PDK_FRAMEWORK_DEBUG
314 for (
int i = 0; i <
GetCount(); i++)
347 for (
int i = 0; i <
GetCount(); i++)
350 if (pNumber->
GetInt() == intvalue)
return pNumber;
366 if (pNumber)
return pNumber;
398 #ifdef PDK_FRAMEWORK_TINYXML
406 #ifdef PDK_FRAMEWORK_TINYXML
419 pParentNode->DeleteChildren();
420 for (
int i = 0; i <
GetCount(); i++)
422 tinyxml2::XMLElement* pItemNode = pParentNode->GetDocument()->NewElement(pszNameString);
423 pParentNode->InsertEndChild(pItemNode);
424 pItemNode->SetAttribute(
"CollectionIdx", i + 1);
442 tinyxml2::XMLElement* pChildNode = pParentNode->FirstChildElement(pszNameString);
455 pChildNode = pChildNode->NextSiblingElement(pszNameString);
467 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
478 EXTAG GetCustomTag() {
return _customtag; }
490 virtual const char*
ClassName() {
return "__FCCollectionData"; }
508 for (
int i = 0; i <
GetCount(); i++)
512 if (!pObject->
Save())
return false;
527 #ifdef PDK_FRAMEWORK_ENTRIES
539 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
544 virtual const char*
ClassName() {
return "__FCCollectionEntryDetail"; }
598 #endif // #ifdef PDK_FRAMEWORK_ENTRIES
609 virtual const char*
ClassName() {
return "__FCCollectionInciOther"; }
684 virtual const char*
ClassName() {
return "__FCCollectionNoInciOther"; }
703 virtual const char*
ClassName() {
return "__FCCollectionGlobal"; }
718 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
719 #ifdef PDK_FRAMEWORK_ENTRIES
724 virtual const char*
ClassName() {
return "__FCCollectionDetail"; }
743 virtual const char*
ClassName() {
return "__FCCollectionPrefs"; }
763 virtual const char*
ClassName() {
return "__FCCollectionNoInciDetail"; }
790 virtual const char*
ClassName() {
return "FCSettingsPairs"; }
804 for (
int i = 0; i <
GetCount(); i++)
822 for (
int i = 0; i <
GetCount(); i++)
866 if (!pKey)
return false;
889 if (!pKey)
return false;
894 if (value < min) value = min;
895 if (value > max) value = max;
945 if (!pString)
return false;
960 #ifdef PDK_FRAMEWORK_ENIGMASTRINGS
967 for (
int i = 0; i <
GetCount(); i++)
992 for (
int i = 0; i <
GetCount(); i++)
995 int separatorposition = pString->
FindFirst(
"=");
996 if (separatorposition < 1)
continue;
1004 pSettingsPairs->
Add(pPair);
1006 return pSettingsPairs;
1023 for (
int i = 0; i <
GetCount(); i++)
1026 if (!pString)
continue;
1028 if (pszSeparator && (i < (
GetCount() - 1)))
1033 return pReturnString;
1036 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
1038 FCString* CreateString_GC(
const char* pszSeparator = NULL);
1059 for (
int i = 0; i <
GetCount(); i++)
1069 return pReturnString;
1072 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
1074 FCString* CreateRowsString_GC(
bool bNewLineAtEnd);
1085 if (!pFindString)
return NULL;
1086 for (
int i = 0; i <
GetCount(); i++)
1089 if (!pString)
continue;
1106 if (!pFindString)
return NULL;
1110 for (
int i = 0; i <
GetCount(); i++)
1115 string.ToLowerCase();
1116 if (
string.IsEqualString(&findstring))
return GetItemAt(i);
1125 if (!pSourceStrings)
return;
1127 for (
int i = 0; i < pSourceStrings->
GetCount(); i++)
1148 for (
int i = 0; i <
GetCount(); i++)
1162 for (
int i =
GetCount() - 1; i >= 0; i--)
1194 #ifdef PDK_FRAMEWORK_STREAMS
1242 virtual const char*
ClassName() {
return "FCNumberCollection"; }
__FCBase * GetItemAt(int index)
Returns the object at the index position. Index is 0-based.
Definition: finaleframework.cpp:12797
int GetInteger(int index=0)
Converts the decimal string contents to an integer value.
Definition: finaleframework.cpp:1792
Class for document-independent font information.
Definition: ff_base.h:1024
__FCBase * FindUserData(void *data_to_find)
Returns the first element in the collection that has the indicated userdata.
Definition: finaleframework.cpp:12894
int GetInt() const
Returns the integer value version of the number.
Definition: ff_base.h:3883
bool Swap(int index1, int index2)
Swaps to items in the collection.
Definition: ff_basecollection.h:245
virtual void StoreToXML(tinyxml2::XMLElement *pParentNode)
Virtual method that is used to store an object's data.
Definition: ff_base.h:549
FCString * Find(FCString *pFindString)
Finds the exact string content in the collection.
Definition: ff_basecollection.h:1083
Base class for all collections based on decendants from __FCBaseData.
Definition: ff_basecollection.h:465
virtual __FCBase * CreateElement()=0
If XML streaming of objects are enabled, override in all __FCCollection base classes.
__FCInciOther * FindItemNo(CMPER cmper, twobyte inci)
Returns the (first) item that has the indicated item number (CMPER) and inci.
Definition: finaleframework.cpp:13182
void ClearAll()
Destroys all the objects in the collection and empties the collection.
Definition: ff_basecollection.h:130
void ClearEmptyStrings()
Removes all empty strings and all NULL pointers from the collection. The objects are disposed from th...
Definition: ff_basecollection.h:1160
virtual bool ReadFromXML(tinyxml2::XMLElement *pParentNode)
Virtual method that is used to read object data.
Definition: ff_base.h:616
void AppendString(FCString *pOtherString)
Appends another string object to the string.
Definition: finaleframework.cpp:1625
void TrimWhitespace()
Trims whitespace at both ends of the string.
Definition: finaleframework.cpp:1369
virtual void DebugDump()
Outputs the class data/information for debugging purposes.
Definition: ff_basecollection.h:309
void SetCString(const char *pszBuffer, int maxchars=-1)
Sets the string, using a C-string version of the string.
Definition: finaleframework.cpp:1030
bool IsIdentical(__FCCollection *pCompareCollection)
Returns true if two collections are considered to be identical.
Definition: ff_basecollection.h:296
void AppendInteger(int value)
Appends an integer value (decimal) to the string.
Definition: finaleframework.cpp:1659
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:790
virtual int ForEachIndex(FCIteratorHandler *pIterator)
Same as ForEach, but the IterateIndex callback of the iterator handler is used instead.
Definition: finaleframework.cpp:12865
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:703
const char * GetEOL() const
Returns the platform-specific end-of-line character(s) as a C-string.
Definition: finaleframework.cpp:1529
virtual int LoadAllForItem(CMPER cmper1, CMPER cmper2base=1)
Loads all subrecords (cmper2's) for a specific item (cmper1).
Definition: finaleframework.cpp:13212
__FCCollectionData()
The constructor.
Definition: ff_basecollection.h:485
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:684
bool ClearItemAt(int index)
Deletes the object at the index position and disposes the object. Index is 0-based.
Definition: finaleframework.cpp:12821
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:57
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:763
bool IsEnigmaFont()
Returns true if the string is an Enigma font command.
Definition: finaleframework.cpp:1426
__FCCollectionPrefs()
The constructor.
Definition: ff_basecollection.h:747
bool AddCopy(FCString *pString)
Adds a copy of the FCString object to the string collection.
Definition: ff_basecollection.h:943
void CopyFrom(FCNumbers *pNumbers)
Copies all number objects from one collection to another. The old numbers are cleared.
Definition: finaleframework.cpp:12934
Base class for "other" data with incis of the __FCInciOther class (where it's common to collect all i...
Definition: ff_basecollection.h:606
void InsertItemAt(__FCBase *pNewItem, int index)
Inserts an item into the collection.
Definition: finaleframework.cpp:12763
bool LoadFolderFiles(FCString *pFolderString)
Gets all files names in a specific folder.
Definition: finaleframework.cpp:13319
FCSettingsPair * AddKeyValue(FCString *pKeyString, FCString *pValueString)
Adds or changes a value to the settings collection.
Definition: ff_basecollection.h:840
int ToEndFrom(int index, FCIteratorHandler *pIterator)
Processes one element after another and iterates from one specific index to the end of the collection...
Definition: finaleframework.cpp:12832
FCNumber * GetItemAt(int index)
Overridden GetItemAt method.
Definition: ff_basecollection.h:342
void SetCustomTag(EXTAG tag)
Sets a custom Enigma tag for the elements of the collection.
Definition: ff_basecollection.h:524
void ToLowerCase()
Transforms the string to lower case.
Definition: finaleframework.cpp:2630
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 d...
Definition: finaleframework.cpp:274
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:724
virtual void SaveNew()
Saving all note entry details as new records to the destination entry.
Definition: finaleframework.cpp:13028
bool RetrieveIntValue(FCString *pKeyString, int *pValue, int min=-1, int max=-1)
Gets an integer value from the settings pair and store it at the data location.
Definition: ff_basecollection.h:886
bool UniqueAdd(__FCBase *pNewItem)
Adds an element to the end of the collection, but only if it doesn't exist in the collection before...
Definition: ff_basecollection.h:101
Base class for the "Other" (ot_*) Enigma structures that don't use the inci parameter.
Definition: ff_other.h:212
__FCCollection()
The constructor.
Definition: ff_basecollection.h:60
FCString * FindNocase(FCString *pFindString)
Finds the string contents in the collection, in a case-insensitive search.
Definition: ff_basecollection.h:1104
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:952
Simple collection class for FCNumber class objects.
Definition: ff_basecollection.h:329
FCStrings()
Definition: ff_basecollection.h:931
Base class for all collections that are streamable to XML.
Definition: ff_basecollection.h:403
__FCBase * DetachItemAt(int index)
Removes the object at the index position. Index is 0-based.
Definition: finaleframework.cpp:12811
bool LoadSubfolders(FCString *pFolderString)
Gets all subfolder names in a specific folder.
Definition: finaleframework.cpp:13370
void ParseEnigmaFontInfo(int index, FCFontInfo *pFontInfo)
Browses the font info available in the strings from the start of the file up until (but not including...
Definition: finaleframework.cpp:13251
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:544
Base class for "other" data without incis (inci always 0.)
Definition: ff_basecollection.h:681
__FCNoInciOther * FindItemNo(CMPER cmper)
Returns the (first) item in the collection that has the indicated item number (CMPER).
Definition: finaleframework.cpp:13198
void SetCustomTag(EXTAG tag)
Sets the custom Enigma tag, for classes that support multiple Enigma tags.
Definition: ff_base.h:827
Collection class for FCNumber instances.
Definition: ff_basecollection.h:1239
bool RetrieveBoolValue(FCString *pKeyString, bool *pValue)
Gets a bool value from the settings pair and store it at the data location.
Definition: ff_basecollection.h:863
Base class specially designed for collections of entry detail classes.
Definition: ff_basecollection.h:537
virtual bool IsIdentical(__FCBase *pCompareObject)
Returns true if the data in the passed object is considered to be identical to the current object...
Definition: ff_base.h:492
void SetValueString(FCString *pString)
Sets the "value" string.
Definition: ff_base.h:2981
int GetCount() const
Returns the number of elements of the collection.
Definition: ff_basecollection.h:86
bool ContainEnigmaFont()
Returns true if any of the strings in the collection is a Enigma font command.
Definition: ff_basecollection.h:965
__FCCollectionDetail()
The constructor.
Definition: ff_basecollection.h:728
Class for storing a "key"+"value" pair of values.
Definition: ff_base.h:2955
void SetString(FCString *pString)
Copies a string.
Definition: finaleframework.cpp:2132
FCString * GetItemAt(int index)
Overridden GetItemAt() method.
Definition: ff_basecollection.h:958
void TrimWhitespaceAll()
Trims leading and trailing whitespace in all the collection's strings.
Definition: ff_basecollection.h:1146
FCSettingsPairs * CreateSettingsPairs()
Create settings pairs based on the strings in the collection. The created collection must be deleted ...
Definition: ff_basecollection.h:989
virtual bool SaveAllForItem(CMPER cmper)
Saves the whole collection to a specific item (cmper).
Definition: finaleframework.cpp:13170
void SortNumerically(bool upwards)
Sorts the numbers in numerical order, upwards or downwards.
Definition: finaleframework.cpp:12967
FCNumbers()
The constructor.
Definition: ff_basecollection.h:336
FCString * CreateString(const char *pszSeparator=NULL)
Creates a FCString object by concatenating all strings in the collection into one.
Definition: ff_basecollection.h:1020
int GetIndexOf(__FCBase *pObject)
Returns the 0-based order index for the object within the collection.
Definition: finaleframework.cpp:12805
bool TruncateAt(int newlength)
Truncates the string at the indicated position.
Definition: ff_base.h:2865
void AddFloat(float afloat)
Appends an integer number to the collection.
Definition: ff_basecollection.h:379
void SetFloat(float value)
Sets the number as a float.
Definition: ff_base.h:3873
Base class for the Finale Framework classes.
Definition: ff_base.h:47
virtual bool SaveAll()
Saves all data in the collection.
Definition: ff_basecollection.h:506
FCString * GetKeyString()
Returns the "key" string.
Definition: ff_base.h:2975
int CompareNoCase(FCString *pString2)
Case insensitive version of Compare.
Definition: ff_base.h:1850
Base class specially designed for collections of detail classes.
Definition: ff_basecollection.h:716
FCSettingsPair * FindPrefixedKey(const char *pszPrefix, int indexnumber)
Finds the pair that contains the key, based on the index number. The search is case insensitive...
Definition: ff_basecollection.h:799
bool IsEqualString(FCString *pString)
Returns true if the string is identical with the parameter. (FCString string version.)
Definition: finaleframework.cpp:1564
int FindFirst(const char *pszSubStr)
Returns the 0-based index for the first occurence of the substring.
Definition: ff_base.h:2135
Base class for "Global" data.
Definition: ff_basecollection.h:700
void SetNoteEntry(FCNoteEntry *pEntry)
Assigns the entry number that should be used for LoadAll, etc.
Definition: ff_basecollection.h:556
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:743
Base class for all data-related classes (that handles Finale data).
Definition: ff_base.h:628
FCNumber * AddUniqueInt(int intvalue)
Adds (appends) an integer number to the collection, but only if it doesn't already exist...
Definition: ff_basecollection.h:363
virtual __FCBase * FindFirst(FCIteratorHandler *pIterator)
Process elements until a match is found.
Definition: finaleframework.cpp:12881
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:1242
virtual bool Save()
Saves the currently loaded to its current location.
Definition: finaleframework.cpp:848
virtual int LoadAll()
Overloaded version of LoadAll. It will load all elements for the current entry number.
Definition: finaleframework.cpp:12997
__FCCollectionNoInciDetail()
The constructor.
Definition: ff_basecollection.h:767
virtual int ForEach(FCIteratorHandler *pIterator)
Processes all elements in the collection (starting with item 0), or until the iterator Iterate() retu...
Definition: finaleframework.cpp:12849
Simple class to put numbers into collections.
Definition: ff_base.h:3840
void StoreIntValue(FCString *pKeyString, int intvalue)
Stores an integer to a settings pair in the collection.
Definition: ff_basecollection.h:910
bool DestroyItemAt(int index)
Deletes the data associated with the object and deletes the item from the collection.
Definition: finaleframework.cpp:13062
bool SaveDataAs(CMPER cmperfrom, CMPER cmperto)
Resaves all subrecords (incis) from the Finale database for a specific item (cmper) to another item (...
Definition: finaleframework.cpp:13101
Base class for "other" (ot_*) data with incis.
Definition: ff_other.h:59
void CopyFrom(FCStrings *pSourceStrings)
Recreates a string collection. Any existing strings in the collection are cleared. NULL entries in the string table are also supported.
Definition: ff_basecollection.h:1123
bool Sort(FCIteratorHandler *pIterator)
Sorts the elements of.
Definition: finaleframework.cpp:12907
Class for iterator handlers.
Definition: ff_iterator.h:25
Base class specially designed for collections of detail classes that doesn't use the inci...
Definition: ff_basecollection.h:760
Class that provides storage for text. This is to achieve platform-transparent text handling...
Definition: ff_base.h:1473
Encapsulates a note entry from an owner class (for example FCNoteEntryCell, FCNoteEntryLayer) class...
Definition: ff_noteframe.h:808
__FCBase * operator[](int index)
Identical to the GetItemAt method.
Definition: ff_basecollection.h:159
bool ElementExists(__FCBase *pQueryItem)
Returns true if the element is found in the collection, otherwise false.
Definition: finaleframework.cpp:12776
bool DeleteCharactersAt(int index, int count)
Removes a range of characters, starting at the 0-based index position.
Definition: finaleframework.cpp:1331
Collection class for FCString class objects.
Definition: ff_basecollection.h:924
virtual int LoadAll()
Loads all available data into the collection.
Definition: finaleframework.cpp:12977
__FCCollectionEntryDetail(FCNoteEntry *pConnectEntry=NULL)
The constructor.
Definition: ff_basecollection.h:550
void SortAlphabetical()
Makes a "non-intelligent" simple alphabetical sort of the string collection.
Definition: finaleframework.cpp:13282
FCNumber * FindInt(int intvalue)
Returns the first object that contains the integer value.
Definition: ff_basecollection.h:345
virtual bool DeleteDataForItem(CMPER cmper)
Deletes all subrecords (incis) from the Finale database for a specific item (cmper).
Definition: finaleframework.cpp:13080
void Add(__FCBase *pNewItem)
Adds an element to the end of the collection.
Definition: finaleframework.cpp:12756
virtual int LoadAllForItem(CMPER cmper)
Loads all subrecords (incis) for a specific item (cmper) and adds them as items to the collection...
Definition: finaleframework.cpp:13154
void AppendCString(const char *pOtherString)
Appends a C-style string to the string.
Definition: finaleframework.cpp:1636
Collection class for FCSettingsPair objects.
Definition: ff_basecollection.h:787
FCString * CreateRowsString(bool bNewLineAtEnd)
Creates a FCString object based on the string collection "rows". It's created by concatenating all st...
Definition: ff_basecollection.h:1056
int LoadAllForEntryNumber(ENTNUM entnum)
Loads all elements for a specific entry number.
Definition: finaleframework.cpp:13042
bool IsEqual(const char *pszString)
Returns true if the string is identical with the parameter.
Definition: ff_base.h:2417
bool IsEmpty()
Returns true if the collection contains no elements.
Definition: ff_basecollection.h:260
bool LoadSymbolFonts()
Loads the user's macsymbolfonts.txt file into the string collection. The string collection will be so...
Definition: finaleframework.cpp:13289
void StoreBoolValue(FCString *pKeyString, bool boolvalue)
Stores a bool value to a settings pair in the collection.
Definition: ff_basecollection.h:902
void DetachAll()
Removes all the objects from the collection, without freeing/destroying the objects.
Definition: ff_basecollection.h:141
FCSettingsPair * FindKey(FCString *pKeyString)
Finds the pair that contains the key. The search is case insensitive.
Definition: ff_basecollection.h:820
__FCBase * GetLastItem()
Returns the last item in the collection.
Definition: ff_basecollection.h:153
Base class specially designed for collections of prefs classes.
Definition: ff_basecollection.h:740
The base class for both browser and collection classes.
Definition: ff_iterator.h:208
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:609
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_basecollection.h:490
virtual ~__FCCollection()
The virtual destructor, which deallocates the array and also all its elements.
Definition: ff_basecollection.h:74
void AddInt(int intvalue)
Appends an integer number to the collection.
Definition: ff_basecollection.h:373
void SetInteger(int i)
Sets the string to an integer.
Definition: finaleframework.cpp:1875
void StoreCollectionToXML(tinyxml2::XMLElement *pParentNode, const char *pszNameString)
Stores the objects in the collection to the XML.
Definition: ff_basecollection.h:417
void ReadCollectionFromXML(tinyxml2::XMLElement *pParentNode, const char *pszNameString)
Reads the objects to the collection from the XML.
Definition: ff_basecollection.h:438
bool LoadSystemFontNames()
Gets all the font names on the system.
Definition: finaleframework.cpp:13433
FCString * GetValueString()
Returns the "value" string.
Definition: ff_base.h:2978
Base class for all collection classes. A collection is a storage that can store multiple objects of s...
Definition: ff_basecollection.h:24
int MoveFrom(__FCCollection *pOtherCollection, bool unique=false)
Moves elements from another collection into this collection. The other will be empty after the operat...
Definition: ff_basecollection.h:270
bool IsEmpty()
Returns true if the string is empty.
Definition: ff_base.h:2461
virtual void DebugDump()
Outputs the class data/information for debugging purposes.
Definition: finaleframework.cpp:547