Finale PDK Framework  0.54
ff_basecollection.h
1 /*
2  * File: ff_basecollection.h
3  * Author: Jari Williamsson
4  *
5  * Created on den 22 november 2010, 19:35
6  */
7 
8 #ifndef FF_BASECOLLECTION_H
9 #define FF_BASECOLLECTION_H
10 
11 #include "ff_base.h"
12 
13 
14 
25 {
26 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
27 
30  int _counter;
31 
35  int _arraysize;
36 
37 
42  void _RequireElement(int no_of_required_elements);
43 
48  void _FreeElements();
49 
50 protected:
54  __FCBase** _pDataArray;
55 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
56 public:
57  virtual const char* ClassName() { return "__FCCollection"; }
58 
61  {
62  _arraysize = 0;
63  _counter = 0;
64  _pDataArray = NULL;
65  }
66 
74  virtual ~__FCCollection()
75  {
76  _FreeElements();
77  if (_pDataArray) delete [] _pDataArray;
78  _pDataArray = NULL;
79  _counter = 0;
80  }
81 
86  int GetCount() const { return _counter; }
87 
94  void Add(__FCBase *pNewItem);
95 
101  bool UniqueAdd(__FCBase *pNewItem)
102  {
103  if (!ElementExists(pNewItem))
104  {
105  Add(pNewItem);
106  return true;
107  }
108  return false;
109  }
110 
117  void InsertItemAt(__FCBase *pNewItem, int index);
118 
123  bool ElementExists(__FCBase* pQueryItem);
124 
130  void ClearAll()
131  {
132  _FreeElements();
133  _counter = 0;
134  }
135 
141  void DetachAll()
142  {
143  _counter = 0;
144  }
145 
150  __FCBase* GetItemAt(int index);
151 
154  {
155  return GetItemAt(GetCount() - 1);
156  }
157 
159  __FCBase* operator [] (int index)
160  {
161  return GetItemAt(index);
162  }
163 
168  int GetIndexOf(__FCBase* pObject);
169 
177  __FCBase* DetachItemAt(int index);
178 
187  bool ClearItemAt(int index);
188 
196  int ToEndFrom(int index, FCIteratorHandler* pIterator);
197 
204  virtual int ForEach(FCIteratorHandler* pIterator);
205 
208  virtual int ForEachIndex(FCIteratorHandler* pIterator);
209 
218  virtual __FCBase* FindFirst(FCIteratorHandler* pIterator);
219 
228  __FCBase* FindUserData(void* data_to_find);
229 
239  bool Sort(FCIteratorHandler* pIterator);
240 
245  bool Swap(int index1, int index2)
246  {
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;
253  return true;
254  }
255 
260  bool IsEmpty() { return (GetCount() == 0); }
261 
270  int MoveFrom(__FCCollection* pOtherCollection, bool unique = false)
271  {
272  int counter = 0;
273  while (pOtherCollection->GetCount() > 0)
274  {
275  if (unique)
276  counter += UniqueAdd(pOtherCollection->GetItemAt(0)) ? 1 : 0;
277  else
278  {
279  Add(pOtherCollection->GetItemAt(0));
280  counter ++;
281  }
282  pOtherCollection->DetachItemAt(0);
283  }
284  return counter;
285  }
286 
296  bool IsIdentical(__FCCollection* pCompareCollection)
297  {
298  if (pCompareCollection->GetCount() != GetCount()) return false;
299  for (int i = 0; i < GetCount(); i++)
300  {
301  __FCBase* pCurrent = GetItemAt(i);
302  __FCBase* pCompare = pCompareCollection->GetItemAt(i);
303  if (!pCurrent->IsIdentical(pCompare)) return false;
304  }
305  return true;
306  }
307 
308 #ifdef PDK_FRAMEWORK_DEBUG
309  virtual void DebugDump()
310  {
312  DebugOutDigit("Array size: ", _arraysize);
313  DebugOutDigit("Number of items: ", GetCount());
314  for (int i = 0; i < GetCount(); i++)
315  {
316  __FCBase* pObject = GetItemAt(i);
317  DebugOutDigit("===> Object item: ", i);
318  pObject->DebugDump();
319  }
320  }
321 #endif
322 };
323 
324 
329 class FCNumbers : public __FCCollection
330 {
331  public:
337 
342  FCNumber* GetItemAt(int index) { return (FCNumber*) __FCCollection::GetItemAt(index); }
343 
345  FCNumber* FindInt(int intvalue)
346  {
347  for (int i = 0; i < GetCount(); i++)
348  {
349  FCNumber* pNumber = GetItemAt(i);
350  if (pNumber->GetInt() == intvalue) return pNumber;
351  }
352  return NULL;
353  }
354 
363  FCNumber* AddUniqueInt(int intvalue)
364  {
365  FCNumber* pNumber = FindInt(intvalue);
366  if (pNumber) return pNumber;
367  pNumber = new FCNumber(intvalue);
368  Add(pNumber);
369  return pNumber;
370  }
371 
373  void AddInt(int intvalue)
374  {
375  Add(new FCNumber(intvalue));
376  }
377 
379  void AddFloat(float afloat)
380  {
381  FCNumber* pNumber = new FCNumber(0);
382  pNumber->SetFloat(afloat);
383  Add(pNumber);
384  }
385 
390  void CopyFrom(FCNumbers* pNumbers);
391 
394  void SortNumerically(bool upwards);
395 };
396 
397 
398 #ifdef PDK_FRAMEWORK_TINYXML
399 
404 {
405 public:
406 #ifdef PDK_FRAMEWORK_TINYXML
407 
409  virtual __FCBase* CreateElement() = 0;
410 #endif
411 
417  void StoreCollectionToXML(tinyxml2::XMLElement* pParentNode, const char* pszNameString)
418  {
419  pParentNode->DeleteChildren();
420  for (int i = 0; i < GetCount(); i++)
421  {
422  tinyxml2::XMLElement* pItemNode = pParentNode->GetDocument()->NewElement(pszNameString);
423  pParentNode->InsertEndChild(pItemNode);
424  pItemNode->SetAttribute("CollectionIdx", i + 1);
425  __FCBase* pObject = GetItemAt(i);
426  pObject->StoreToXML(pItemNode); /* Call virtual method to store object data */
427  }
428  }
429 
438  void ReadCollectionFromXML(tinyxml2::XMLElement* pParentNode, const char* pszNameString)
439  {
440  ClearAll();
441 
442  tinyxml2::XMLElement* pChildNode = pParentNode->FirstChildElement(pszNameString);
443  while (pChildNode)
444  {
445  __FCBase* pObject = CreateElement();
446 
447  /* Call virtual method to read object data */
448  if (pObject->ReadFromXML(pChildNode))
449  {
450  Add(pObject);
451  }
452  else
453  delete pObject;
454 
455  pChildNode = pChildNode->NextSiblingElement(pszNameString);
456  }
457  }
458 };
459 #endif
460 
466 {
467 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
468  EXTAG _customtag;
469 protected:
473  virtual __FCBaseData* CreateElement() = 0;
474 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
475 
478  EXTAG GetCustomTag() { return _customtag; }
479 public:
480 
486  {
487  _customtag = 0;
488  }
489 
490  virtual const char* ClassName() { return "__FCCollectionData"; }
491 
498  virtual int LoadAll();
499 
506  virtual bool SaveAll()
507  {
508  for (int i = 0; i < GetCount(); i++)
509  {
510  __FCBaseData* pObject = (__FCBaseData*) _pDataArray[i];
511  pObject->SetCustomTag(_customtag);
512  if (!pObject->Save()) return false;
513  }
514  return true;
515  }
516 
524  void SetCustomTag(EXTAG tag) { _customtag = tag; }
525 };
526 
527 #ifdef PDK_FRAMEWORK_ENTRIES
528 class FCNoteEntry;
529 
538 {
539 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
540 protected:
541  FCNoteEntry* _pNoteEntry; /* Used for LoadAll */
542 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
543 public:
544  virtual const char* ClassName() { return "__FCCollectionEntryDetail"; }
545 
551  {
552  SetNoteEntry(pConnectEntry);
553  }
554 
556  void SetNoteEntry(FCNoteEntry* pEntry) { _pNoteEntry = pEntry; }
557 
565  virtual int LoadAll();
566 
574  virtual void SaveNew();
575 
580  int LoadAllForEntryNumber(ENTNUM entnum);
581 
582 
596  bool DestroyItemAt(int index);
597 };
598 #endif // #ifdef PDK_FRAMEWORK_ENTRIES
599 
600 
601 class __FCInciOther;
602 
607 {
608 public:
609  virtual const char* ClassName() { return "__FCCollectionInciOther"; }
610 
620  virtual bool DeleteDataForItem(CMPER cmper);
621 
637  bool SaveDataAs(CMPER cmperfrom,
638  CMPER cmperto);
639 
649  virtual int LoadAllForItem(CMPER cmper);
650 
662  virtual bool SaveAllForItem(CMPER cmper);
663 
670  __FCInciOther* FindItemNo(CMPER cmper, twobyte inci);
671 };
672 
673 
674 class __FCNoInciOther;
675 
682 {
683 public:
684  virtual const char* ClassName() { return "__FCCollectionNoInciOther"; }
685 
691  __FCNoInciOther* FindItemNo(CMPER cmper);
692 
693 };
694 
695 
701 {
702 public:
703  virtual const char* ClassName() { return "__FCCollectionGlobal"; }
704 };
705 
706 
707 
708 
717 {
718 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
719 #ifdef PDK_FRAMEWORK_ENTRIES
720  FCNoteEntry* _pNoteEntry; /* Used for LoadAll */
721 #endif
722 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
723 public:
724  virtual const char* ClassName() { return "__FCCollectionDetail"; }
725 
729  {
730  }
731 };
732 
741 {
742 public:
743  virtual const char* ClassName() { return "__FCCollectionPrefs"; }
744 
748  {
749  }
750 
751 };
752 
753 
754 
761 {
762 public:
763  virtual const char* ClassName() { return "__FCCollectionNoInciDetail"; }
764 
768  {
769  }
770 
778  virtual int LoadAllForItem(CMPER cmper1, CMPER cmper2base = 1);
779 };
780 
788 {
789 public:
790  virtual const char* ClassName() { return "FCSettingsPairs"; }
791 
799  FCSettingsPair* FindPrefixedKey(const char* pszPrefix, int indexnumber)
800  {
801  FCString trystring;
802  trystring.SetCString(pszPrefix);
803  trystring.AppendInteger(indexnumber);
804  for (int i = 0; i < GetCount(); i++)
805  {
806  FCSettingsPair* pPair = (FCSettingsPair*) GetItemAt(i);
807  if (trystring.CompareNoCase(pPair->GetKeyString()) == 0)
808  {
809  return pPair;
810  }
811  }
812  return NULL;
813  }
814 
821  {
822  for (int i = 0; i < GetCount(); i++)
823  {
824  FCSettingsPair* pPair = (FCSettingsPair*) GetItemAt(i);
825  if (pKeyString->CompareNoCase(pPair->GetKeyString()) == 0)
826  {
827  return pPair;
828  }
829  }
830  return NULL;
831  }
832 
840  FCSettingsPair* AddKeyValue(FCString* pKeyString, FCString* pValueString)
841  {
842  FCSettingsPair* pFoundPair = FindKey(pKeyString);
843  if (pFoundPair)
844  {
845  pFoundPair->SetValueString(pValueString);
846  return pFoundPair;
847  }
848  FCSettingsPair* pNewPair = new FCSettingsPair(pKeyString, pValueString);
849  Add(pNewPair);
850  return pNewPair;
851  }
852 
853 
863  bool RetrieveBoolValue(FCString* pKeyString, bool* pValue)
864  {
865  FCSettingsPair* pKey = FindKey(pKeyString);
866  if (!pKey) return false;
867  *pValue = pKey->GetValueString()->IsEqual("1");
868  return true;
869  }
870 
886  bool RetrieveIntValue(FCString* pKeyString, int* pValue, int min = -1, int max = -1)
887  {
888  FCSettingsPair* pKey = FindKey(pKeyString);
889  if (!pKey) return false;
890  int value = pKey->GetValueString()->GetInteger();
891  if (min < max)
892  {
893  /* Check for max/min values */
894  if (value < min) value = min;
895  if (value > max) value = max;
896  }
897  *pValue = value;
898  return true;
899  }
900 
902  void StoreBoolValue(FCString* pKeyString, bool boolvalue)
903  {
904  FCString valuestring;
905  valuestring.SetInteger(boolvalue ? 1 : 0);
906  AddKeyValue(pKeyString, &valuestring);
907  }
908 
910  void StoreIntValue(FCString* pKeyString, int intvalue)
911  {
912  FCString valuestring;
913  valuestring.SetInteger(intvalue);
914  AddKeyValue(pKeyString, &valuestring);
915  }
916 };
917 
918 
924 class FCStrings : public __FCCollection
925 {
926 public:
932  {
933  }
934 
943  bool AddCopy(FCString* pString)
944  {
945  if (!pString) return false;
946  FCString* pNewString = new FCString();
947  pNewString->SetString(pString);
948  Add(pNewString);
949  return false;
950  }
951 
952  virtual const char* ClassName() { return "FCStrings"; }
953 
958  FCString* GetItemAt(int index) { return (FCString*) __FCCollection::GetItemAt(index); }
959 
960 #ifdef PDK_FRAMEWORK_ENIGMASTRINGS
961 
966  {
967  for (int i = 0; i < GetCount(); i++)
968  {
969  FCString* pString = (FCString*) GetItemAt(i);
970  if (pString->IsEnigmaFont()) return true;
971  }
972  return false;
973  }
974 #endif
975 
990  {
991  FCSettingsPairs* pSettingsPairs = new FCSettingsPairs();
992  for (int i = 0; i < GetCount(); i++)
993  {
994  FCString* pString = (FCString*) GetItemAt(i);
995  int separatorposition = pString->FindFirst("=");
996  if (separatorposition < 1) continue;
997  FCString keystring, valuestring;
998  keystring.SetString(pString);
999  valuestring.SetString(pString);
1000  keystring.TruncateAt(separatorposition);
1001  valuestring.DeleteCharactersAt(0, separatorposition + 1);
1002 
1003  FCSettingsPair* pPair = new FCSettingsPair(&keystring, &valuestring);
1004  pSettingsPairs->Add(pPair);
1005  }
1006  return pSettingsPairs;
1007  }
1008 
1020  FCString* CreateString(const char* pszSeparator = NULL)
1021  {
1022  FCString* pReturnString = new FCString;
1023  for (int i = 0; i < GetCount(); i++)
1024  {
1025  FCString* pString = (FCString*) GetItemAt(i);
1026  if (!pString) continue;
1027  pReturnString->AppendString(pString);
1028  if (pszSeparator && (i < (GetCount() - 1)))
1029  {
1030  pReturnString->AppendCString(pszSeparator);
1031  }
1032  }
1033  return pReturnString;
1034  }
1035 
1036 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
1037 
1038  FCString* CreateString_GC(const char* pszSeparator = NULL);
1039 #endif
1040 
1056  FCString* CreateRowsString(bool bNewLineAtEnd)
1057  {
1058  FCString* pReturnString = new FCString;
1059  for (int i = 0; i < GetCount(); i++)
1060  {
1061  FCString* pString = (FCString*) GetItemAt(i);
1062  if (pString) pReturnString->AppendString(pString);
1063  if (i < (GetCount() - 1))
1064  {
1065  pReturnString->AppendCString(pReturnString->GetEOL());
1066  }
1067  }
1068  if (bNewLineAtEnd) pReturnString->AppendCString(pReturnString->GetEOL());
1069  return pReturnString;
1070  }
1071 
1072 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
1073 
1074  FCString* CreateRowsString_GC(bool bNewLineAtEnd);
1075 #endif
1076 
1083  FCString* Find(FCString* pFindString)
1084  {
1085  if (!pFindString) return NULL;
1086  for (int i = 0; i < GetCount(); i++)
1087  {
1088  FCString* pString = (FCString*) GetItemAt(i);
1089  if (!pString) continue;
1090  if (pString->IsEqualString(pFindString)) return pString;
1091  }
1092  return NULL;
1093  }
1094 
1105  {
1106  if (!pFindString) return NULL;
1107  FCString findstring;
1108  findstring.SetString(pFindString);
1109  findstring.ToLowerCase();
1110  for (int i = 0; i < GetCount(); i++)
1111  {
1112  if (!GetItemAt(i)) continue;
1113  FCString string;
1114  string.SetString(GetItemAt(i));
1115  string.ToLowerCase();
1116  if (string.IsEqualString(&findstring)) return GetItemAt(i);
1117  }
1118  return NULL;
1119  }
1120 
1123  void CopyFrom(FCStrings* pSourceStrings)
1124  {
1125  if (!pSourceStrings) return;
1126  ClearAll();
1127  for (int i = 0; i < pSourceStrings->GetCount(); i++)
1128  {
1129  FCString* pSourceString = pSourceStrings->GetItemAt(i);
1130  if (pSourceString)
1131  {
1132  FCString* pNewString = new FCString();
1133  pNewString->SetString(pSourceString);
1134  Add(pNewString);
1135  }
1136  else
1137  Add(NULL);
1138  }
1139  }
1140 
1147  {
1148  for (int i = 0; i < GetCount(); i++)
1149  {
1150  FCString* pString = GetItemAt(i);
1151  if (pString) pString->TrimWhitespace();
1152  }
1153  }
1154 
1161  {
1162  for (int i = GetCount() - 1; i >= 0; i--)
1163  {
1164  FCString* pString = GetItemAt(i);
1165  if (!pString)
1166  {
1167  ClearItemAt(i);
1168  }
1169  else if (pString->IsEmpty())
1170  {
1171  ClearItemAt(i);
1172  }
1173  }
1174  }
1175 
1181  void SortAlphabetical();
1182 
1192  void ParseEnigmaFontInfo(int index, FCFontInfo* pFontInfo);
1193 
1194 #ifdef PDK_FRAMEWORK_STREAMS
1195 
1204  bool LoadSymbolFonts();
1205 #endif
1206 
1215  bool LoadFolderFiles(FCString* pFolderString);
1216 
1223  bool LoadSubfolders(FCString* pFolderString);
1224 
1234  bool LoadSystemFontNames();
1235 };
1236 
1237 
1240 {
1241  public:
1242  virtual const char* ClassName() { return "FCNumberCollection"; }
1243 };
1244 
1245 
1246 #endif /* FF_BASECOLLECTION_H */
1247 
__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