CFx SDK Documentation  2020SP3
daiUtils.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2019, 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 valueuable
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-2019 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 #ifndef _DAI_UTILS_H_
25 #define _DAI_UTILS_H_
26 
27 #include "OdaCommon.h"
28 #include "daiBuildOptions.h"
29 #include "DbHandle.h"
30 #include "daiConsts.h"
31 #include "OdString.h"
32 
33 
34 namespace OdDAI
35 {
36  namespace Utils
37  {
38  inline bool isUnset(const float & value) { return value != value; }
39  inline bool isUnset(const double & value) { return value != value; }
40  inline bool isUnset(const int value) { return value == Consts::OdIntUnset; }
41  inline bool isUnset(const OdString & value) { return value.getLength() == Consts::OdStringUnsetLength && value.compare(Consts::OdStringUnset) == 0; }
42  inline bool isUnset(const OdAnsiString & value) { return value.getLength() == Consts::OdStringUnsetLength && value.compare(Consts::OdStringUnset) == 0; }
43  inline bool isUnset(const char * value) { return strlen(value) == Consts::OdStringUnsetLength && strcmp(value, Consts::OdStringUnset) == 0; }
44  inline bool isUnset(const OdUInt64 & value) { return Consts::OdHandleUnset.getHandle() == value; }
45  inline bool isUnset(const OdDbHandle & value) { return Consts::OdHandleUnset.getHandle() == (OdUInt64)value; }
46  inline bool isUnset(const OdDAIObjectId & value) { return value.isNull(); }
47  }
48 
49 
50  class OdFileDescriptionAuto;
51  class OdFileNameAuto;
52  class OdFileSchemaAuto;
53 
55  bool DAI_EXPORT operator==(const OdFileNameAuto& left, const OdFileNameAuto& right);
56  bool DAI_EXPORT operator==(const OdFileSchemaAuto& left, const OdFileSchemaAuto& right);
57 
58  class OdSelect;
59 
60  bool DAI_EXPORT operator==(const OdDAI::OdSelect& left, const OdDAI::OdSelect& right);
61  bool DAI_EXPORT operator!=(const OdDAI::OdSelect& left, const OdDAI::OdSelect& right);
62 
63  namespace Utils
64  {
65  bool DAI_EXPORT encodeText(const OdString& encodeWhat, OdAnsiString& result);
66  bool DAI_EXPORT decodeText(const OdAnsiString& decodeWhat, OdString& result);
67  }
68 }
69 
70 #endif // _DAI_UTILS_H_
71 
OdDAI::OdFileDescriptionAuto
Definition: FileDescriptionAutoImpl.h:38
OdString
Definition: OdString.h:95
OdDAI::Utils::encodeText
bool DAI_EXPORT encodeText(const OdString &encodeWhat, OdAnsiString &result)
OdDAIObjectId
Definition: daiObjectId.h:67
OdDAI
Definition: daiAccessDefines.h:31
OdString.h
OdDAI::operator!=
bool DAI_EXPORT operator!=(const OdDAI::OdSelect &left, const OdDAI::OdSelect &right)
daiConsts.h
DbHandle.h
OdaCommon.h
OdDAI::OdFileNameAuto
Definition: FileNameAutoImpl.h:38
OdDAI::Utils::decodeText
bool DAI_EXPORT decodeText(const OdAnsiString &decodeWhat, OdString &result)
daiBuildOptions.h
OdDbHandle
Definition: DbHandle.h:67
value
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
OdDAI::OdFileSchemaAuto
Definition: FileSchemaAutoImpl.h:38
OdDAI::operator==
bool DAI_EXPORT operator==(const OdFileDescriptionAuto &left, const OdFileDescriptionAuto &right)
OdDAI::OdSelect
Definition: daiSelect.h:41
DAI_EXPORT
#define DAI_EXPORT
Definition: daiBuildOptions.h:28
OdDAI::Utils::isUnset
bool isUnset(const float &value)
Definition: daiUtils.h:38
OdUInt64
Definition: Int64.h:137