CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbField.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24
25#ifndef OD_DBFIELD_H
26#define OD_DBFIELD_H
27
28#include "TD_PackPush.h"
29
30#include "DbObject.h"
31#include "DbFieldValue.h"
32#include "OdValue.h"
33
34class OdDbField;
36
41
42
47 typedef struct OdFd
48{
50 {
52 };
53
55
56class OdDbField;
57
62
63//*************************************************************************
64// OdDbField
65//*************************************************************************
66
79{
80public:
81 enum State
82 {
83 kInitialized = 0x01, // Field was initialized by the evaluator.
84 kCompiled = 0x02, // Field was compiled.
85 kModified = 0x04, // Field was modified, but not evaluated.
86 kEvaluated = 0x08, // Field was evaluated.
87 kHasCache = 0x10, // Field has evaluated cache.
88 kHasFormattedString = 0x20 // Internal use only.
89 };
90
92 {
93 kDisable = 0, // Do not evaluate field.
94 kOnOpen = 0x01, // Evaluate field when a drawing is opened.
95 kOnSave = 0x02, // Evaluate field when a drawing is saved.
96 kOnPlot = 0x04, // Evaluate field when a drawing is printed.
97 kOnEtransmit = 0x08, // Evaluate field when a drawing is etransmitted.
98 kOnRegen = 0x10, // Evaluate field when a drawing is regenerated.
99 kOnDemand = 0x20, // Evaluate field when demanded.
100 kAutomatic = (kOnOpen | kOnSave | kOnPlot | kOnEtransmit | kOnRegen | kOnDemand) // Evaluate automatically.
101 };
102
104 {
105 kOpen = 0x01, // Field is being evaluated when a drawing is opened.
106 kSave = 0x02, // Field is being evaluated when a drawing is saved.
107 kPlot = 0x04, // Field is being evaluated when a drawing is printed.
108 kEtransmit = 0x08, // Field is being evaluated when a drawing is etransmitted.
109 kRegen = 0x10, // Field is being evaluated when a drawing is regenerated.
110 kDemand = 0x20, // Field is being evaluated when demanded.
111 kPreview = 0x40 // Field is being evaluated when a drawing is previewed.
112 };
113
115 {
116 kNotYetEvaluated = 0x01, // Evaluation not performed.
117 kSuccess = 0x02, // Evaluation complete: Successful.
118 kEvaluatorNotFound = 0x04, // Evaluator for the field not found.
119 kSyntaxError = 0x08, // Evaluation complete: Syntax error in field code.
120 kInvalidCode = 0x10, // Evaluation complete: Invalid field code.
121 kInvalidContext = 0x20, // Evaluation complete: Invalid context to evaluate field.
122 kOtherError = 0x40 // Evaluation complete: Other evaluation error.
123 };
124
126 {
127 kRawCode = 0x00, // Returns the raw main field code. Ignored by setFieldCode().
128 kFieldCode = 0x01, // Returns the raw field code with child codes substituted. Ignored by setFieldCode().
129 kEvaluatedText = 0x02, // Returns the evaluated text. Ignored by setFieldCode().
130 kEvaluatedChildren = 0x04, // Returns the field code with evaluated text for child fields. Ignored by setFieldCode().
131 kObjectReference = 0x08, // Returns embedded text as references to child fields. Ignored by setFieldCode().
132 kAddMarkers = 0x10, // Returns embedded text as field codes enclosed in field markers. Ignored by setFieldCode().
133 kEscapeBackslash = 0x20, // Converts single backslashes to double backslashes. Ignored by setFieldCode().
134 kStripOptions = 0x40, // Strips the standard options from the field code. Ignored by setFieldCode().
135 kPreserveFields = 0x80, // Internal use only. Ignored by getFieldCode().
136 kTextField = 0x100, // Treats the field as text with embedded fields. Ignored by getFieldCode().
137 kPreserveOptions = 0x200, // Ignored by getFieldCode(). For internal use.
138 kDetachChildren = 0x400, // Ignored by getFieldCode(). For internal use.
139 kChildObjectReference = 0x800, // Get child fields as object references. For internal use.
140 kForExpression = 0x1000 // Get the value in a format used in arithmatic expressions (e.g. vector child values are put in square brackets). For internal use. Ignored by setFieldCode().
141 };
142
144 {
145 kSkipFilingResult = 0x01 // Don't file field value.
146 };
147
148public:
150
152
153 // OdDbField(const OdString& fieldCode, bool bTextField = false);
154 // ~OdDbField(void);
155
167 OdDbObject* pOwner,
168 const OdString& propertyName);
169
176 OdDbDatabase* pDb);
177
195
214 // OdUInt32* errCode = 0,
215 // OdString* errMsg = 0) const;
216
236
258 OdDbField::EvalOption evaluationOption);
259
272
285 OdDbField::FilingOption filingOption);
286
295
302 const OdString& evaluatorId);
303
307 bool isTextField() const;
308
309 // OdResult convertToTextField (void);
310
311 // OdString getFieldCode (OdDbField::FieldCodeFlag nFlag, OdArray<OdDbField*>* pChildFields = 0,
312 // OdDb::OpenMode mode = OdDb::kForRead) const;
313
337
338 // OdArray<OdDbField*>* pChildFields = 0,
339 // OdDb::OpenMode mode = OdDb::kForRead) const;
340
341
369 const OdString& fieldCode,
371 OdDbFieldArray* pChildFields = 0);
372
381
386
394 OdUInt32 childIndex,
395 OdDb::OpenMode openMode);
396
401
411 const OdString& format);
412
413
431 int nContext,
432 OdDbDatabase* pDb = 0,
433 int* pNumFound = 0,
434 int* pNumEvaluated = 0);
435
436
461
469
482 OdFieldValue& pValue) const;
483
484 bool hasHyperlink() const;
485
487 OdString& psDescription,
488 OdString& psSubLocation,
489 OdString& psDisplayString) const;
490
492 const OdString& psDescription,
493 const OdString& psSubLocation = OdString::kEmpty);
494
496
503 const OdString& key) const;
504
512 const OdString& key,
513 const OdFieldValue& pData);
514
524 virtual OdDbObjectId setField(const OdString& propName, OdDbField* pField) ODRX_OVERRIDE;
525
535public:
536 // Base class overrides
537
539 OdDbDwgFiler* pFiler);
540 virtual void dwgOutFields(
541 OdDbDwgFiler* pFiler) const;
543 OdDbDxfFiler* pFiler);
544 virtual void dxfOutFields(
545 OdDbDxfFiler* pFiler) const;
546
547 virtual void subClose();
548};
549
550#define TEXT_FIELD_NAME OD_T("TEXT")
551
554
555#include "TD_PackPop.h"
556#endif // OD_DBFIELD_H
#define DBENT_EXPORT
Definition: DbExport.h:67
OdSmartPtr< OdDbField > OdDbFieldPtr
Definition: DbField.h:35
DBENT_EXPORT OdDbFieldPtr copyTextFieldToObject(OdDbFieldPtr srcField, OdDbObject *pObj)
DBENT_EXPORT OdDbFieldPtr copyFieldWithChild(OdDbFieldPtr srcField)
OdArray< OdDbFieldPtr > OdDbFieldArray
Definition: DbField.h:40
unsigned int OdUInt32
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
OdResult setData(const OdString &key, const OdFieldValue &pData)
OdResult setFieldCode(const OdString &fieldCode, OdDbField::FieldCodeFlag flags=(OdDbField::FieldCodeFlag) 0, OdDbFieldArray *pChildFields=0)
OdResult setInObject(OdDbObject *pOwner, const OdString &propertyName)
OdResult removeField(OdDbObjectId fieldId)
bool hasHyperlink() const
OdString getFormat() const
OdResult setHyperlink(const OdString &psName, const OdString &psDescription, const OdString &psSubLocation=OdString::kEmpty)
OdString evaluatorId() const
OdResult evaluate(int nContext, OdDbDatabase *pDb=0, int *pNumFound=0, int *pNumEvaluated=0)
OdDbField::FilingOption filingOption() const
OdDbField::State state() const
OdResult getHyperlink(OdString &psName, OdString &psDescription, OdString &psSubLocation, OdString &psDisplayString) const
OdDbFieldPtr getChild(OdUInt32 childIndex, OdDb::OpenMode openMode)
OdUInt32 childCount() const
OdDbField::EvalOption evaluationOption() const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdResult setFormat(const OdString &format)
OdValue::DataType dataType() const
EvalOption
Definition: DbField.h:92
FieldCodeFlag
Definition: DbField.h:126
OdResult getValue(OdFieldValue &pValue) const
ODDB_DECLARE_MEMBERS(OdDbField)
OdResult setEvaluationOption(OdDbField::EvalOption evaluationOption)
virtual OdResult postInDatabase(OdDbDatabase *pDb)
virtual void subClose()
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdResult removeHyperlink()
virtual OdDbObjectId setField(const OdString &propName, OdDbField *pField) ODRX_OVERRIDE
OdResult setEvaluatorId(const OdString &evaluatorId)
OdResult setFieldCodeWithParse(const OdString &fieldCode, OdDbField::FieldCodeFlag flags=(OdDbField::FieldCodeFlag) 0)
OdFieldValue getData(const OdString &key) const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
FilingOption
Definition: DbField.h:144
OdString getValue() const
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
bool isTextField() const
OdResult setFilingOption(OdDbField::FilingOption filingOption)
OdDbField::EvalStatus evaluationStatus() const
OdString getFieldCode(OdDbField::FieldCodeFlag flags)
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
DataType
Definition: OdValue.h:46
GLint GLint GLint GLsizei GLsizei GLenum format
Definition: gles2_ext.h:111
OpenMode
Definition: DbObjectId.h:54
Definition: DbField.h:48
EvalFields
Definition: DbField.h:50
@ kEvalRecursive
Definition: DbField.h:51