CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
OdValue.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
26#ifndef _ODVALUE_INCLUDED_
27#define _ODVALUE_INCLUDED_
28
29#include "TD_PackPush.h"
30#include "StaticRxObject.h"
31#include "OdTimeStamp.h"
32
33class OdValueImpl;
34class OdValue;
36
40class DBENT_EXPORT OdValue : public OdStaticRxObject<OdRxObject>
41{
42public:
44
46 {
47 kUnknown = 0x00,
48 kLong = 0x01,
49 kDouble = 0x02,
50 kString = 0x04,
51 kDate = 0x08,
52 kPoint = 0x10,
53 k3dPoint = 0x20,
54 kObjectId = 0x40,
55 kBuffer = 0x80,
56 kResbuf = 0x100,
57 kGeneral = 0x200,
58 kColor = 0x400
59 };
60
62 {
63 kUnitless = 0x00,
64 kDistance = 0x01,
65 kAngle = 0x02,
66 kArea = 0x04,
67 kVolume = 0x08,
68 kCurrency = 0x10,
69 kPercentage = 0x20
70 };
71
73 {
74 kParseOptionNone = 0x00,
75 kSetDefaultFormat = 0x01,
76 kPreserveMtextFormat = 0x02,
77 kConvertTextToValue = 0x04,
78 kChangeDataType = 0x08,
79 kParseTextForFieldCode = 0x10
80 };
81
83 {
84 kFormatOptionNone = 0x00,
85 kForEditing = 0x01,
86 kForExpression = 0x02,
87 kUseMaximumPrecision = 0x04,
88 kIgnoreMtextFormat = 0x08
89 };
90
91
92public:
94
95 OdValue(void);
96 ~OdValue(void);
97
101 OdValue(double value);
102 OdValue(const OdInt64& date);
103 OdValue(double x, double y);
104 OdValue(double x, double y, double z);
105 OdValue(const OdDbObjectId& objectId);
106 OdValue(const OdResBufPtr& resBuf);
107 OdValue(const OdTimeStamp& time);
108 // OdValue(const OdRxVariantValue& var);
109
110 OdValue(const void* buffer, OdInt32 bufferSize);
111
117 bool reset();
141 bool isValid () const;
142
149 operator OdString() const;
150 operator OdInt32() const;
151 operator double() const;
152 operator OdInt64() const;
153 operator OdDbObjectId() const;
154
160 OdValue& operator=(const OdDbObjectId& objectId);
162
163 // OdValue& operator= (const OdRxVariantValue& var);
164
165 // bool get (const OdChar*& pszValue) const;
166
174 bool get(OdString& value) const;
182 bool get(OdInt32& value) const;
190 bool get(double& value) const;
199 bool get(OdInt64& date) const;
209 bool get(double& x, double& y) const;
220 bool get(double& x, double& y, double& z) const;
229 bool get(OdDbObjectId& objectId) const;
238 bool get(OdResBufPtr& resBuf) const;
239
240 // bool get(OdRxVariantValue& var) const;
241
251 bool get(void*& pBuf, OdInt32& bufferSize) const;
252
261 bool get(OdTimeStamp& time) const;
262
271 bool set(const OdValue& value);
280 bool set(const OdString& value);
298 bool set(double value);
307 bool set(const OdInt64& date);
317 bool set(double x, double y);
328 bool set(double x, double y, double z);
337 bool set(const OdDbObjectId& objectId);
346 bool set(const OdResBufPtr& resBuf);
347
348 // bool set (const OdRxVariantValue& var);
349
359 bool set(const void* buffer, OdInt32 bufferSize);
360
369 bool set(const OdTimeStamp& time);
370
371// bool reset (void);
378 bool reset (OdValue::DataType nDataType);
379// bool resetValue (void);
380
383 OdString getFormat (void) const;
384 void setFormat (const OdString& pszFormat);
385
386// bool parse (const OdString& pszText,
387// OdValue::DataType nDataType,
388// OdValue::UnitType nUnitType,
389// const ACHAR* pszFormat,
390// OdValue::ParseOption nOption,
391// const AcDbObjectId* pTextStyleId);
392//
393
394 OdString format(OdDbDatabase* pDb = 0) const;
396 OdString format(const OdString& pszFormat, OdValue::FormatOption nOption, OdDbDatabase* pDb = 0);
397 bool format(const OdString& pszFormat, OdString& pszValue, OdDbDatabase* pDb = 0) const;
398
399 bool convertTo (OdValue::DataType nDataType,
400 OdValue::UnitType nUnitType);
401 bool convertTo (OdValue::DataType nDataType,
402 OdValue::UnitType nUnitType,
403 bool bResetIfIncompatible);
404
406 OdDbDwgFiler* pFiler);
407 virtual void dwgOutFields(
408 OdDbDwgFiler* pFiler) const;
409
411 OdDbDxfFiler* pFiler);
412 virtual void dxfOutFields(
413 OdDbDxfFiler* pFiler) const;
414
415protected:
416 OdValue(OdValueImpl* pValImpl);
417
418 friend class OdDbSystemInternals;
419 OdValueImpl* m_pImpl;
420};
421
422#include "TD_PackPop.h"
423
424#endif // _ODVALUE_INCLUDED_
#define DBENT_EXPORT
Definition: DbExport.h:67
@ kUnknown
int OdInt32
OdResult
Definition: OdResult.h:29
OdSmartPtr< OdValue > OdValuePtr
Definition: OdValue.h:35
Definition: Int64.h:43
bool get(OdInt32 &value) const
bool get(double &value) const
DataType
Definition: OdValue.h:46
OdValue & operator=(double value)
bool get(OdString &value) const
OdValue(void)
OdValue(double value)
bool set(const OdTimeStamp &time)
OdString format(OdDbDatabase *pDb=0) const
bool get(void *&pBuf, OdInt32 &bufferSize) const
bool set(const OdString &value)
bool convertTo(OdValue::DataType nDataType, OdValue::UnitType nUnitType)
ParseOption
Definition: OdValue.h:73
bool set(const OdInt64 &date)
OdValue(const OdTimeStamp &time)
bool get(OdResBufPtr &resBuf) const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
bool get(double &x, double &y) const
bool isValid() const
OdString format(const OdString &pszFormat, OdValue::FormatOption nOption, OdDbDatabase *pDb=0)
bool set(OdInt32 value)
OdValue & operator=(OdInt32 value)
bool set(double value)
bool reset()
OdValue & operator=(OdInt64 date)
bool get(OdInt64 &date) const
OdValue(OdValueImpl *pValImpl)
bool set(double x, double y, double z)
bool format(const OdString &pszFormat, OdString &pszValue, OdDbDatabase *pDb=0) const
OdValue(const OdValue &value)
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
bool set(const OdDbObjectId &objectId)
bool set(const void *buffer, OdInt32 bufferSize)
OdValue & operator=(const OdString &value)
OdValue & operator=(const OdValue &value)
ODRX_HEAP_OPERATORS()
OdValue::UnitType unitType(void) const
bool get(double &x, double &y, double &z) const
bool set(const OdResBufPtr &resBuf)
OdValue(const void *buffer, OdInt32 bufferSize)
OdValue & operator=(const OdDbObjectId &objectId)
bool convertTo(OdValue::DataType nDataType, OdValue::UnitType nUnitType, bool bResetIfIncompatible)
OdValue(const OdDbObjectId &objectId)
OdValue(OdInt32 value)
ODRX_DECLARE_MEMBERS(OdValue)
bool get(OdTimeStamp &time) const
bool get(OdDbObjectId &objectId) const
~OdValue(void)
bool set(double x, double y)
OdValue(const OdInt64 &date)
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
bool set(const OdValue &value)
void setUnitType(OdValue::UnitType nUnitType)
OdString format(OdValue::FormatOption nOption, OdDbDatabase *pDb=0)
OdString getFormat(void) const
OdValue & operator=(const OdResBufPtr &resBuf)
OdValue::DataType dataType() const
UnitType
Definition: OdValue.h:62
bool reset(OdValue::DataType nDataType)
OdValue(const OdResBufPtr &resBuf)
OdValueImpl * m_pImpl
Definition: OdValue.h:419
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
FormatOption
Definition: OdValue.h:83
OdValue(const OdString &value)
OdValue(double x, double y)
void setFormat(const OdString &pszFormat)
OdValue(double x, double y, double z)
GLfloat GLfloat GLfloat z
Definition: gles2_ext.h:318
GLuint buffer
Definition: gles2_ext.h:178
GLfloat x
Definition: gles2_ext.h:314
GLfloat GLfloat y
Definition: gles2_ext.h:316
GLsizei const GLfloat * value
Definition: gles2_ext.h:302