OOFILE  1.9
oof3.h
Go to the documentation of this file.
1 #ifndef H_OOF3
2 #define H_OOF3
3 
4 // COPYRIGHT 1994 A.D. Software, All rights reserved
5 
6 // OOFILE database non-numeric field-related classes
7 // see also oof4.h
8 
9 #ifndef H_OOF1
10  #include "oof1.h"
11 #endif
12 #ifdef _Macintosh
13  #if defined _Macintosh_Carbon
14  #ifndef __CARBON__
15  #ifdef _Macintosh_Mach
16  #include <Carbon/Carbon.h>
17  #else
18  # include <Carbon.h>
19  #endif
20  #endif
21  #else
22  #include <Types.h>
23  #endif
24 #endif
25 
27 OOFILE_EXPORT std::ostream& operator<<(std::ostream&, OOF_fieldTypes);
28 
29 class dbChar;
30 class dbText;
31 
47 public:
48  virtual dbCalculator* clone() const=0;
49  virtual dbCalculator* cloneOwned(dbField* newOwner) const; // has default implementation as not necessary to override
50  virtual ~dbCalculator() {};
51 };
52 
53 
54 
64 public:
65  enum FieldIsStandaloneT {eFieldIsStandalone};
66  enum { kKeyLengthAutoCalculated = USHRT_MAX};
67 
68 public:
69  dbField(const OOF_IndexOptions);
70  dbField(const char* fieldName=0);
71  dbField(const char* fieldName, const OOF_IndexOptions);
72  dbField(const dbField&);
73  dbField(FieldIsStandaloneT);
74  virtual ~dbField();
75  virtual dbField* clone() const=0;
76 
77  virtual void postCloneTableCleanup() {};
78 
79  virtual oofString name() const;
80 
81 // additional setting operators
82  void index(const OOF_IndexOptions=kIndexed);
83  void indexPartialKeyLen(unsigned short);
84  void setName(const char* name);
85 
86  bool hasDefaultCalculator() const;
87  void useCalculatorOnlyForDefaults();
88  bool storesCalculatedValues() const;
89  void storeCalculatedValues();
90  bool usingCalculator() const;
91 
92 // reflective operators
93  const char* tableName() const;
94  bool fieldIsStandalone() const;
95  virtual bool fieldIsSameTypeAs(const dbField*) const;
96  virtual void describe(std::ostream&) const;
97 // virtual unsigned short countValues() const;
98  virtual OOF_fieldTypes fieldType() const=0;
99  virtual OOF_fieldTypes nativeType() const;
100  virtual unsigned long fieldStorageLen() const=0;
101  virtual unsigned long fieldMinWrapWidth() const;
102  virtual unsigned long fieldUsualWrapWidth() const;
103  dbTable* fieldTable() const;
104  unsigned long fieldDataLen() const;
105  virtual bool isEmpty() const;
106  bool isDirty() const;
107  fieldNumT fieldNumber() const;
108  virtual const oofString& fieldName() const;
109  OOF_IndexOptions fieldIndexOptions() const;
110  bool fieldIndexIgnoresNulls() const;
111  bool fieldIndexIsCompressLeading() const;
112  bool fieldIndexIsCompressPadding() const;
113  virtual bool fieldIsIndexed() const;
114  bool fieldIsPartiallyIndexed() const;
115  virtual bool fieldIsKeywordIndexed() const;
116  virtual bool fieldIsUniqueIndexed() const;
117  unsigned short fieldNumIndexes() const;
118  unsigned short fieldKeyLen() const;
119 
120  bool caseSensitive() const;
121  virtual bool fieldIsBlob() const;
122  virtual bool fieldIsBinary() const;
123  virtual bool fieldIsVirtual() const;
124  dbField* equivalentFieldFromTable(dbTable*) const;
125  bool valueIsDuplicate() const;
126  virtual dbQueryClause* valueAsQueryLiteral() const; // has default imp for non searchables
127  bool fieldIsJoinKey() const;
128 
129 // data access
130 // removed due to VC5 (possibly ANSI rules, or MS bug) operator oofString() const;
131  virtual void clear() {};
132  virtual void setString(const char*) {};
133  virtual void setNumber(long) {};
134  void operator=(const char*);
135  virtual oofString copyString() const;
136  virtual void getChars(char* ioBuff, unsigned long& outLen) const;
137  virtual const char* asChars() const;
138  virtual void extract(std::ostream&) const;
139  virtual bool insert(std::istream&, char fieldSep, char recSep);
140  virtual void copyValueFrom(const dbField*) {}; // should override but only if makes sense to join on field type
141  virtual void copyValueIfDifferent(const dbField*) {};
142  virtual bool validateContents();
143  virtual oofWordParser* words() const;
144  void saveDefaultCalculatedValue();
145  void saveStoredCalculatedValue();
146 
147  virtual void generateTestData(bool /*generateRandom*/, unsigned long /*seedOrCount*/) {};
148 
149 
150 protected:
151  void CalculateWith(dbCalculator* adoptedCalculator, bool useOnlyForDefaults);
152  virtual void CopyCalculatedValueToBuffer();
153 
154 // data storage
159 
160 private:
161  OOF_IndexOptions mIndexOptions;
162  unsigned short mPartialKeyLength;
163  oofString mFieldName;
164  bool mCalculateOnlyDefaults;
165  bool mStoreCalculatedValues;
166 
167  friend class dbTable;
168 };
170 std::istream& operator>>(std::istream&, dbField*);
171 std::istream& operator>>(std::istream&, dbField&);
172 
173 
174 class dbQueryBinary;
175 class dbQueryTrinary;
176 class dbQueryBinaryCombo;
177 class oofWordParser;
178 
179 
187 public:
190  virtual ~OOF_mixKeywordableField();
191 
192  void indexWords(oofWordParser* adoptedParser = 0);
193  oofWordParser* wordParser() const;
194 
195  // searches
196  dbQueryBinary hasWord(const char* str) const;
197  dbQueryBinary hasAnyWordsDelimited(const char*, char delimiter);
198  dbQueryBinary hasAllWordsDelimited(const char*, char delimiter);
199  dbQueryBinary hasAnyWordsOf(const char **schStrs, unsigned long count);
200  dbQueryBinary hasAllWordsOf(const char **schStrs, unsigned long count);
201  dbQueryBinary hasAnyWordsOf(oofWordParser*);
202  dbQueryBinary hasAllWordsOf(oofWordParser*);
203 
204  dbQueryBinary hasWordStartsWith(const char* str) const;
205  dbQueryBinary hasAnyWordsStartsWithDelimited(const char*, char delimiter);
206  dbQueryBinary hasAllWordsStartsWithDelimited(const char*, char delimiter);
207  dbQueryBinary hasAnyWordsStartsWithOf(const char **schStrs, unsigned long count);
208  dbQueryBinary hasAllWordsStartsWithOf(const char **schStrs, unsigned long count);
209  dbQueryBinary hasAnyWordsStartsWithOf(oofWordParser*);
210  dbQueryBinary hasAllWordsStartsWithOf(oofWordParser*);
211 
212 protected:
213 // data storage
216 };
217 
218 
223 public:
224  virtual ~dbCharCalculator() {};
225  virtual const char* calc(const dbChar*)=0;
226 };
227 
228 
229 
237 public:
238  dbCharStripperCalculator(dbChar& stripsField, char toStrip = ' ');
239 
240  virtual const char* calc(const dbChar*);
241  virtual dbCalculator* clone() const;
242  virtual dbCalculator* cloneOwned(dbField*) const;
243 
244 private:
245  dbChar* mStripsField;
246  char mStripChar;
247  oofString mStrippedStr;
248 };
249 
250 
256 public:
257 // constructors
258  dbChar(unsigned long fieldWidth=80, const char* fieldName=0);
259  dbChar(unsigned long fieldWidth, const OOF_IndexOptions indexOptions);
260  dbChar(unsigned long fieldWidth, const char *fieldName, const OOF_IndexOptions indexOptions);
261  dbChar(dbField::FieldIsStandaloneT k, unsigned long fieldWidth=80);
262  dbChar(const dbChar&);
263  virtual ~dbChar();
264  virtual dbField* clone() const;
265 
266  dbChar& calculateWith( dbCharCalculator* adoptedCalculator, bool useOnlyForDefaults=false);
267  dbCharCalculator* calculator() const;
268 
269 // reflective operators
270  virtual bool fieldIsSameTypeAs(const dbField*) const;
271  virtual void describe(std::ostream&) const;
272  virtual OOF_fieldTypes fieldType() const;
273  virtual bool fieldIsKeywordIndexed() const;
274  virtual bool fieldIsBinary() const;
275  virtual unsigned long fieldUsualWrapWidth() const;
276  virtual unsigned long fieldStorageLen() const;
277  virtual bool isEmpty() const;
278  unsigned short length() const;
279  virtual dbQueryClause* valueAsQueryLiteral() const;
280 
281 // search factories
282  dbQueryBinary operator==(const char*) const;
283  dbQueryBinary operator<(const char*) const;
284  dbQueryBinary operator<=(const char*) const;
285  dbQueryBinary operator>=(const char*) const;
286  dbQueryBinary operator>(const char*) const;
287  dbQueryBinary operator!=(const char*) const;
288  dbQueryBinary startsWith(const char*) const;
289 // dbQueryBinary contains(const char*) const;
290  dbQueryTrinary between(const char*, const char*) const;
291  dbQueryTrinary outside(const char*, const char*) const;
292 
293 // data access
294 
295 // getters
296  const char* value() const;
297  virtual const char* asChars() const;
298  virtual oofString copyString() const;
299  virtual void getChars(char* ioBuff, unsigned long& ioLen) const;
300  operator const char*() const;
301  virtual void extract(std::ostream& os) const;
302  virtual void copyValueFrom(const dbField*);
303  virtual void copyValueIfDifferent(const dbField*);
304  virtual oofWordParser* words() const;
305 #ifdef _Macintosh
306  void getStr255(Str255 s) const;
307 #endif
308 
309 // setters
310 #ifdef _Macintosh
311  void setStr255(const Str255 s);
312 #endif
313  virtual void clear();
314  virtual void setString(const char*);
315  virtual void setNumber(long);
316  virtual void setString(const oofString&); //lint !e1411 isn't hiding original
317  dbChar& operator=(const char*);
318  dbChar& operator=(char);
319  void operator+=(char);
320  void operator+=(const char*);
321  void setChars(const char* str , unsigned long charLen);
322  dbChar& operator=(const dbChar&);
323  virtual bool insert(std::istream&, char fieldSep, char recSep);
324 // char& operator[](unsigned short);
325  virtual void generateTestData(bool generateRandom, unsigned long seedOrCount);
326 
327 private:
328  void CompleteInit();
329 
330 protected:
331  virtual void CopyCalculatedValueToBuffer();
332 // data storage
333  unsigned long mMaxLength;
334 
335  friend class OOF_dbaseBackend; // can fiddle our length, didn't want to grant public interface for that!
336 };
337 
338 
339 class dbBLOB;
348 private: // owned totally by a dbBLOB, only exposed here to allow inline definitions
349 // constructors
350  dbBLOBstorage(dbBLOB* owner);
351  dbBLOBstorage(const dbBLOBstorage&) { assert(0); };
352  virtual ~dbBLOBstorage();
353 
354 // reflective operators
355  bool isDirty() const;
356 
357 // data access
358  char* bodyAddress() const;
359 #ifdef OOF_DebugDumpBlobState
360  void blobState(std::ostream& os) const;
361 #endif
362  void reset();
363  char* allocRoomFor(unsigned long);
364  char* orphanBody();
365  void adoptBody(char* body, unsigned long bodyLen);
366  void markDirty();
367  void setChars(const char* str , unsigned long charLen);
368  void setBytes(const char* buf , unsigned long bufLen);
369  void convertLineEndings();
370 
371 protected:
372 // data storage
373  char* mBody; // owned
374  unsigned long mBodyLength; // allow for part-using the block
377 
378 friend class dbBLOB;
379 friend class dbText;
380 };
381 
382 
387 class OOFILE_EXPORT dbBLOB : public dbField {
388 public:
389 // constructors
390  dbBLOB(const OOF_IndexOptions indexOptions);
391  dbBLOB(const char* fieldName=0) ;
392  dbBLOB(const char* fieldName, const OOF_IndexOptions indexOptions);
394  dbBLOB(const dbBLOB&);
395  virtual ~dbBLOB();
396  virtual dbField* clone() const;
397 // debug stuff
398 #ifdef OOF_DebugDumpBlobState
399  void blobState(std::ostream& os);
400 #endif
401 // reflective operators
402  virtual OOF_fieldTypes fieldType() const;
403  virtual unsigned long fieldStorageLen() const;
404  virtual bool isEmpty() const;
405  virtual unsigned long length() const;
406  virtual bool fieldIsBlob() const;
407  bool isDirty() const;
408  bool loaded() const;
409 
410 // data access - all read ops are const because handled by separate storage
411  virtual void extract(std::ostream& os) const;
412  char* bodyAddress() const;
413  void reset() const;
414  char* allocRoomFor(unsigned long) const;
415  char* orphanBody() const;
416  void adoptBody(void* body, unsigned long bodyLen) const; // used by backends
417  void adoptBody(void* body, unsigned long bodyLen, unsigned long usedLen) const;
418  void append(const dbBLOB&);
419  virtual void append(const void* appendBody, unsigned long bodyLen, unsigned long usedLen=ULONG_MAX);
420  void setBytes(const void* buf , unsigned long bufLen);
421  void markDirty() const;
422  dbBLOB& operator=(const dbBLOB&);
423  void operator+=(const dbBLOB&);
424  virtual void generateTestData(bool generateRandom, unsigned long seedOrCount);
425 
426 protected:
427  void SetLength(unsigned long len) const;
428  void LoadField() const;
429 
430 // data storage
432  bool mIsTextField; // used by dbText & other possible descendants to change behaviour
433 
434 friend void dbBLOBstorage::setChars(const char* str , unsigned long charLen);
435 friend void dbBLOBstorage::setBytes(const char* buf , unsigned long bufLen);
436 };
437 
438 
444 public:
445  virtual ~dbTextCalculator() {};
446  virtual const char* calc(const dbText*)=0;
447 
448 protected:
450 };
451 
452 
460 public:
461 // constructors
462  dbText(const OOF_IndexOptions);
463  dbText(const char* fieldName=0);
464  dbText(const char* fieldName, const OOF_IndexOptions);
466  dbText(const dbText&);
467  virtual ~dbText() {};
468  virtual dbField* clone() const;
469 
470  dbText& calculateWith( dbTextCalculator* adoptedCalculator, bool useOnlyForDefaults=false);
471  dbTextCalculator* calculator() const;
472 
473 // global settings
474  static void convertsLineEndingsOnLoad(bool willConvert);
475  static bool convertsLineEndingsOnLoad();
476 
477 // reflective operators
478  virtual OOF_fieldTypes fieldType() const;
479  virtual OOF_fieldTypes nativeType() const;
480  virtual unsigned long fieldUsualWrapWidth() const;
481  virtual bool fieldIsKeywordIndexed() const;
482  virtual bool fieldIsBinary() const;
483 
484 
485 // search factories
486  dbQueryBinary operator==(const char*) const;
487  dbQueryBinary operator<(const char*) const;
488  dbQueryBinary operator<=(const char*) const;
489  dbQueryBinary operator>=(const char*) const;
490  dbQueryBinary operator>(const char*) const;
491  dbQueryBinary operator!=(const char*) const;
492 // dbQueryBinary contains(const char*) const;
493 
494 // data access
495  const char* value() const;
496  virtual dbQueryClause* valueAsQueryLiteral() const;
497  virtual unsigned long length() const;
498  virtual const char* asChars() const;
499  virtual oofString copyString() const;
500  virtual void getChars(char* ioBuff, unsigned long& outLen) const;
501  operator const char*() const;
502  virtual void clear();
503  virtual void setString(const char*);
504  virtual void setNumber(long);
505  virtual void setString(const oofString&); //lint !e1411 isn't hiding original
506  dbText& operator=(char);
507  dbText& operator=(const char*);
508  dbText& operator=(const dbText&);
509  void operator+=(char);
510  void operator+=(const char*);
511  virtual void append(const void* appendBody, unsigned long bodyLen=ULONG_MAX, unsigned long usedLen=ULONG_MAX);
512  void setChars(const char* str , unsigned long charLen);
513  void adoptString(oofString& adoptedString) const;
514  virtual void generateTestData(bool generateRandom, unsigned long seedOrCount);
515  virtual void extract(std::ostream& os) const;
516  virtual bool insert(std::istream&, char fieldSep, char recSep);
517  virtual void copyValueFrom(const dbField*);
518  virtual void copyValueIfDifferent(const dbField*);
519  virtual oofWordParser* words() const;
520 
521 
522 protected:
523  virtual void CopyCalculatedValueToBuffer();
524  static bool sConvertsLineEndingsOnLoad; // = false
525 };
526 
527 
533 public:
534 // constructors
535  dbFixedBinary(long fieldWidth=4, const char* fieldName=0);
536  dbFixedBinary(long fieldWidth, const OOF_IndexOptions indexOptions);
537  dbFixedBinary(long fieldWidth, const char* fieldName, const OOF_IndexOptions indexOptions);
538  // use default copy ctor
541  virtual ~dbFixedBinary() {};
542  virtual dbField* clone() const;
543 
544 // reflective operators
545  virtual bool fieldIsSameTypeAs(const dbField*) const;
546  virtual OOF_fieldTypes fieldType() const;
547  virtual unsigned long fieldStorageLen() const;
548 
549 // data access
550  dbFixedBinary& operator=(const char* str);
551  virtual void setString(const char*);
552  void setValue(const void* str);
553  void setByte(char c, unsigned long offset);
554  void clear();
555  virtual void extract(std::ostream& os) const;
556  virtual void generateTestData(bool generateRandom, unsigned long seedOrCount);
557  virtual void describe(std::ostream& os) const;
558 
559 protected:
560 
561 // data storage
562  unsigned long mBodyLength;
563 
564 
565 };
566 
567 
576 public:
577 // constructors
579  dbCompoundField(const char* fieldName=0);
580  dbCompoundField(const char* fieldName, const OOF_IndexOptions);
582  virtual ~dbCompoundField() {};
583  virtual dbField* clone() const;
584 
585  virtual void addSegment(dbField&);
586 
587 // data output
588  virtual void extract(std::ostream& os) const;
589 
590 // reflective operators
591  virtual bool fieldIsSameTypeAs(const dbField*) const;
592  virtual OOF_fieldTypes fieldType() const;
593  virtual unsigned long fieldStorageLen() const;
594  virtual bool fieldIsVirtual() const;
595 
596  const dbField* field(unsigned int) const;
597 
598 // search factories
599  dbQueryBinary operator==(const char*) const;
600  dbQueryBinary operator<(const char*) const;
601  dbQueryBinary operator<=(const char*) const;
602  dbQueryBinary operator>=(const char*) const;
603  dbQueryBinary operator>(const char*) const;
604  dbQueryBinary operator!=(const char*) const;
605  dbQueryBinary startsWith(const char* str) const;
606 
607 // data storage
608 private:
609  unsigned int mTotalLength;
610 };
611 
612 
620 public:
621  dbFieldCopier(oofBroadcaster* listensTo, unsigned short copyOnMessage, dbField* copyFrom, dbField* copyTo);
622  // use default copy ctor
623  virtual ~dbFieldCopier();
624 
625  virtual bool receiveMsg(OOFmsgT msg, unsigned long senderDefined);
626 protected:
627 // data storage
628  dbField *mCopyFrom, *mCopyTo;
630 };
631 
632 
638 {
639 private: // yep, wholly owned
640  OOF_Segment(const dbField& fld);
641  OOF_Segment(const dbField* fld);
642 // use default copy ctor
643  ~OOF_Segment() {};
644 
645 public:
646  void setReverse();
647  bool isReversed() const;
648  bool operator!=(const OOF_Segment* rhs) const;
649 
650 
651 private:
652 // data storage
653  fieldNumT mFieldNo;
654  bool mReversed;
655 
656 friend class OOF_FieldSegOwner;
657 };
658 
659 
660 // -------------------------------------------------------
661 // d b F i e l d
662 // -------------------------------------------------------
663 #if 0
664 inline dbField::operator dbField*()
665 {
666  return this;
667 };
668 #endif
669 
670 inline void
671 dbField::operator=(const char* str)
672 {
673  setString(str); // this is a virtual call - a way to get a virtual operator= without the hassles of overriding
674 }
675 
676 
677 inline OOF_IndexOptions
679 {
680  return mIndexOptions;
681 }
682 
683 
684 inline void
685 dbField::indexPartialKeyLen(unsigned short inLen)
686 {
687  mPartialKeyLength = inLen;
688 }
689 
690 
691 inline bool
693 {
694  return (mPartialKeyLength!=kKeyLengthAutoCalculated);
695 }
696 
697 
698 inline bool
700 {
701  bool ret = ((mIndexOptions & kIndexNoNulls)!=0);
702  return ret;
703 }
704 
705 
706 inline bool
708 {
709  bool ret = ((mIndexOptions & kIndexCompressLeading)!=0);
710  return ret;
711 }
712 
713 
714 inline bool
716 {
717  bool ret = ((mIndexOptions & kIndexCompressPadding)!=0);
718  return ret;
719 }
720 
721 
722 inline unsigned short
724 {
725  if (mIndexOptions==kNotIndexed)
726  return 0;
727  else
728  return 1; // NOT YET IMPLEMENTED - may later have multiple indexes/field
729 }
730 
731 
732 inline bool
734 {
735  return (mTable==0);
736 }
737 
738 
739 /* inline
740 dbField::operator oofString() const
741 {
742  return copyString();
743 }
744 */
745 
746 inline bool
748 {
749  return ((mIndexOptions & kIndexCaseSensitive)!=0);
750 }
751 
752 
753 inline fieldNumT
755 {
756  return mFieldNumber;
757 }
758 
759 
760 inline unsigned long
762 {
763  assert(!fieldIsStandalone());
764  return mBackend->fieldDataLen(this);
765 }
766 
767 
768 inline const oofString&
770 {
771  return mFieldName;
772 }
773 
774 
775 OOFILE_EXPORT inline std::ostream&
776 operator<<(std::ostream& os, const dbField& fld)
777 {
778  fld.extract(os);
779  return os;
780 }
781 
782 
783 OOFILE_EXPORT inline std::ostream&
784 operator<<(std::ostream& os, const dbField* fld)
785 {
786  fld->extract(os);
787  return os;
788 }
789 
790 
791 inline bool
793 {
794  return (mCalculateOnlyDefaults);
795 }
796 
797 
798 inline void
800 {
801  mCalculateOnlyDefaults = true;
802 }
803 
804 
805 inline bool
807 {
808  return mStoreCalculatedValues;
809 }
810 
811 
812 inline void
814 {
815  mStoreCalculatedValues = true;
816 }
817 
818 
819 // -------------------------------------------------------
820 // d b C h a r
821 // -------------------------------------------------------
822 // friend
823 OOFILE_EXPORT inline std::ostream&
824 operator<<(std::ostream& os, const dbChar& fld)
825 {
826  fld.extract(os);
827  return os;
828 }
829 
830 
831 inline void
833 {
834  setChars(str, str.length());
835 }
836 
837 
838 inline const char*
840 {
841  return (const char*)*this;
842 }
843 
844 
845 inline dbCharCalculator*
847 {
848  return (dbCharCalculator*) mCalculator; // safe downcast
849 }
850 
851 
852 
853 // -------------------------------------------------------
854 // d b B L O B
855 // -------------------------------------------------------
856 inline bool
858 {
859  return mStorage->isDirty();
860 }
861 
862 
863 inline void
865 {
866  mStorage->markDirty();
867 }
868 
869 
870 inline bool
872 {
873  return mStorage->mLoaded;
874 }
875 
876 
877 inline void
879 {
880  mStorage->reset();
881 }
882 
883 
884 inline char*
885 dbBLOB::allocRoomFor(unsigned long len) const
886 {
887  SetLength(len);
888  return mStorage->allocRoomFor(len);
889 }
890 
891 
892 inline char*
894 {
895  return mStorage->orphanBody();
896 }
897 
898 
899 // -------------------------------------------------------
900 // d b T e x t
901 // -------------------------------------------------------
902 OOFILE_EXPORT inline std::ostream&
903 operator<<(std::ostream& os, const dbText& fld)
904 {
905  fld.extract(os);
906  return os;
907 }
908 
909 
910 inline void
912 {
913  sConvertsLineEndingsOnLoad = willConvert;
914 }
915 
916 
917 inline bool
919 {
921 }
922 
923 
924 inline void
926 {
927  setChars(str, str.length());
928 }
929 
930 
931 inline const char*
933 {
934  return (const char*)*this;
935 }
936 
937 
938 inline dbTextCalculator*
940 {
941  return (dbTextCalculator*) mCalculator; // safe downcast
942 }
943 
944 
945 
946 // -------------------------------------------------------
947 // O O F _ S e g m e n t
948 // -------------------------------------------------------
949 
950 inline void
952 {
953  mReversed = true;
954 }
955 
956 
957 inline bool
959 {
960  return mReversed;
961 }
962 
963 
964 inline bool
966 {
967  bool ret = ((mFieldNo != rhs->mFieldNo) || (mReversed != rhs->mReversed));
968  return ret;
969 }
970 
971 
972 #endif
973 
bool mIsTextField
Definition: oof3.h:432
Mixin for classes allowing you to declare segments based on fields.
Definition: oof1.h:1247
static bool convertsLineEndingsOnLoad()
Definition: oof3.h:918
virtual OOF_fieldTypes fieldType() const
Definition: oof3.cpp:2125
Definition: oof3.h:26
unsigned long mBodyLength
Definition: oof3.h:562
Definition: oof1.h:236
virtual dbCalculator * clone() const =0
virtual void setNumber(long)
Definition: oof3.h:133
Database backend for a single dBase-compatible file.
Definition: oofdbasx.h:20
Persistent field used to store a fixed-length binary object.
Definition: oof3.h:532
fieldNumT fieldNumber() const
Definition: oof3.h:754
virtual ~dbCalculator()
Definition: oof3.h:50
virtual const oofString & fieldName() const
Definition: oof3.h:769
dbCharCalculator * calculator() const
Definition: oof3.h:846
dbBLOB * mOwner
Definition: oof3.h:376
Binary query combining two sub-queries.
Definition: oofquery.h:203
virtual void copyValueFrom(const dbField *)
Definition: oof3.h:140
Definition: oof3.h:26
Base class for user-replaceable word parser.
Definition: oofwords.h:40
void setChars(const char *str, unsigned long charLen)
Definition: oof3.cpp:1683
void operator+=(const dbBLOB &)
Definition: oof3.cpp:2246
Calculator attached to a dbChar.
Definition: oof3.h:222
bool fieldIndexIgnoresNulls() const
Definition: oof3.h:699
bool hasDefaultCalculator() const
Definition: oof3.h:792
unsigned long fieldDataLen() const
Definition: oof3.h:761
Highest level used to assemble queries.
Definition: oofquery.h:46
void indexPartialKeyLen(unsigned short)
Definition: oof3.h:685
const char * value() const
Definition: oof3.h:839
bool isDirty() const
Definition: oof3.h:857
const char * value() const
Definition: oof3.h:932
char * mBody
Definition: oof3.h:373
bool fieldIsStandalone() const
Definition: oof3.h:733
virtual bool isEmpty() const
Definition: oof3.cpp:170
virtual void extract(std::ostream &os) const
Definition: oof3.cpp:1762
virtual unsigned long fieldDataLen(const dbField *) const =0
virtual void generateTestData(bool generateRandom, unsigned long seedOrCount)
Definition: oof3.cpp:2291
OOF_tableBackend * mBackend
Definition: oof3.h:155
virtual void extract(std::ostream &os) const
Definition: oof3.cpp:2307
virtual ~dbCharCalculator()
Definition: oof3.h:224
void append(const dbBLOB &)
Definition: oof3.cpp:2209
bool loaded() const
Definition: oof3.h:871
char * allocRoomFor(unsigned long) const
Definition: oof3.h:885
virtual unsigned long fieldStorageLen() const =0
Definition: oof3.h:26
Utility class establishing copy dependency between fields.
Definition: oof3.h:619
bool caseSensitive() const
Definition: oof3.h:747
Special limited oofReceiver which will only ever listen to one oofBroadcaster at a time...
Definition: oofmsg.h:133
virtual bool receiveMsg(OOFmsgT msg, unsigned long senderDefined)
The default receiveMsg behaviour is to delete yourself when the broadcaster closes.
Definition: oofmsg.cpp:275
Common trinary query for field, eg: People.Salary.between(50000, 90000); Very similar to dbQueryBinar...
Definition: oofquery.h:263
void reset() const
Definition: oof3.h:878
bool mDirty
Definition: oof3.h:375
fieldNumT mFieldNumber
Definition: oof3.h:157
void setChars(const char *str, unsigned long charLen)
Copy string up to the specified length or maximum size of this fixed length string.
Definition: oof3.cpp:1136
void setReverse()
Definition: oof3.h:951
virtual ~dbTextCalculator()
Definition: oof3.h:445
bool isReversed() const
Definition: oof3.h:958
virtual OOF_fieldTypes nativeType() const
Definition: oof3.cpp:301
Mixin class for fields that are keyword-indexed.
Definition: oof3.h:186
virtual const char * calc(const dbChar *)=0
virtual void copyValueIfDifferent(const dbField *)
Definition: oof3.h:141
unsigned short fieldNumIndexes() const
Definition: oof3.h:723
Common binary query for field, eg: People.Salary > 90000.
Definition: oofquery.h:165
virtual bool fieldIsKeywordIndexed() const
Definition: oof3.cpp:415
dbCalculator * mCalculator
Definition: oof3.h:158
Calculator attached to a dbText field.
Definition: oof3.h:443
Definition: oof3.h:26
virtual void setString(const char *)
Definition: oof3.h:132
oofString mBuffer
Definition: oof3.h:449
virtual void postCloneTableCleanup()
Definition: oof3.h:77
void SetLength(unsigned long len) const
Definition: oof3.cpp:2169
virtual void generateTestData(bool, unsigned long)
Definition: oof3.h:147
virtual void addSegment(dbField &)
Definition: oof1.cpp:2861
Definition: oof3.h:26
unsigned long length() const
Primary test: oofStringTest::emptyStringByNullInitIsLenZero()
Definition: oofstr.h:447
virtual unsigned long length() const
Definition: oof3.cpp:2145
Abstract interface to database backend.
Definition: oof1.h:1047
dbTable * mTable
Definition: oof3.h:156
Base class for a calculator attached to a dbField.
Definition: oof3.h:46
void operator=(const char *)
Definition: oof3.h:671
bool fieldIndexIsCompressLeading() const
Definition: oof3.h:707
virtual bool fieldIsSameTypeAs(const dbField *) const
Definition: oof3.cpp:557
bool mLoaded
Definition: oof3.h:375
dbBLOBstorage * mStorage
Definition: oof3.h:431
virtual void getChars(char *ioBuff, unsigned long &outLen) const
Definition: oof3.cpp:481
virtual dbQueryClause * valueAsQueryLiteral() const
Definition: oof3.cpp:184
Temporary cache field used to store dbBlob contents.
Definition: oof3.h:347
virtual bool fieldIsBinary() const
Definition: oof3.cpp:393
oofWordParser * mParser
Definition: oof3.h:214
dbBLOB & operator=(const dbBLOB &)
Definition: oof3.cpp:2254
Persistent field used to store a fixed-length string.
Definition: oof3.h:255
virtual void CopyCalculatedValueToBuffer()
Definition: oof3.cpp:163
Base class used to refer to main OOFILE classes and provide base reflective API.
Definition: oof1.h:49
OOF_fieldTypes
Definition: oof3.h:26
virtual void describe(std::ostream &) const
Provide human-readable information about object.
Definition: oof3.cpp:544
Persistent field used to store a set of segments referring to other fields.
Definition: oof3.h:575
virtual oofString name() const
Definition: oof1.cpp:349
Calculator to strip all embedded characters.
Definition: oof3.h:236
unsigned short fieldNumT
Definition: oof1.h:276
virtual void extract(std::ostream &os) const
Definition: oof3.cpp:1189
Base class for persistent tables.
Definition: oof1.h:452
virtual void extract(std::ostream &) const
Definition: oof3.cpp:506
Definition: oof3.h:26
virtual bool insert(std::istream &, char fieldSep, char recSep)
Definition: oof3.cpp:513
virtual void clear()
Definition: oof3.h:131
Definition: oof3.h:26
Portable highly capable string class.
Definition: oofstr.h:101
Definition: oof3.h:26
virtual void describe(std::ostream &) const
Provide human-readable information about object.
Definition: oof1.cpp:342
virtual unsigned long fieldUsualWrapWidth() const
Definition: oof3.cpp:235
void markDirty() const
Definition: oof3.h:864
bool isDirty() const
Definition: oof3.cpp:564
void storeCalculatedValues()
Definition: oof3.h:813
bool operator!=(const OOF_Segment *rhs) const
Definition: oof3.h:965
virtual void setString(const char *)
Definition: oof3.cpp:1114
virtual dbField * clone() const =0
void useCalculatorOnlyForDefaults()
Definition: oof3.h:799
virtual bool fieldIsVirtual() const
Definition: oof3.cpp:400
bool fieldIndexIsCompressPadding() const
Definition: oof3.h:715
dbTextCalculator * calculator() const
Definition: oof3.h:939
virtual ~dbCompoundField()
Definition: oof3.h:582
Generic broadcaster for messaging.
Definition: oofmsg.h:76
Persistent field used to store a variable length string.
Definition: oof3.h:459
OOF_IndexOptions
type used to specify index options for dbField's.
Definition: oof1.h:236
static bool sConvertsLineEndingsOnLoad
Definition: oof3.h:524
Internal class used to specify segments for dbCompoundField and dbSorter.
Definition: oof3.h:637
virtual oofString copyString() const
Definition: oof3.cpp:472
std::ostream & operator<<(std::ostream &, const oofE_Base &)
virtual void setString(const char *)
Definition: oof3.cpp:1676
FieldIsStandaloneT
Definition: oof3.h:65
dbFixedBinary(dbField::FieldIsStandaloneT k)
Definition: oof3.h:540
dbField * mCopyTo
Definition: oof3.h:628
unsigned long mMaxLength
Maximum length that can be stored in the field.
Definition: oof3.h:333
virtual OOF_fieldTypes fieldType() const =0
unsigned long OOFmsgT
Definition: oofmsg.h:31
dbField * dbFieldPtr
Definition: oof3.h:169
Persistent field used to store an arbitrary binary object.
Definition: oof3.h:387
virtual ~dbFixedBinary()
Definition: oof3.h:541
OOFmsgT mCopyOnMessage
Definition: oof3.h:629
dbField * mThisField
Definition: oof3.h:215
#define OOFILE_EXPORT
Prefix for OOFILE database & general classes to enable optional DLL linking.
Definition: oof0.h:187
virtual oofWordParser * words() const
Definition: oof3.cpp:251
bool fieldIsPartiallyIndexed() const
Definition: oof3.h:692
virtual ~dbText()
Definition: oof3.h:467
bool storesCalculatedValues() const
Definition: oof3.h:806
virtual dbField * clone() const
Definition: oof3.cpp:2118
char * orphanBody() const
Definition: oof3.h:893
Base class for persistent fields in dbTable's.
Definition: oof3.h:63
virtual dbCalculator * cloneOwned(dbField *newOwner) const
Definition: oof3.cpp:1406
virtual const char * asChars() const
Definition: oof3.cpp:243
unsigned long mBodyLength
Definition: oof3.h:374
OOF_IndexOptions fieldIndexOptions() const
Definition: oof3.h:678
std::istream & operator>>(std::istream &, dbField *)
virtual bool fieldIsBlob() const
Definition: oof3.cpp:386