18 #define DEFAULT_VERSION_MAJOR 1
19 #define DEFAULT_VERSION_MINOR 0
148 virtual void MakeClassAbstract() = 0;
239 bool m_includeBaseContainers;
240 bool m_includeSupplementalAttributes;
242 m_includeSupplementalAttributes(includeSupplementalAttributes) {};
249 virtual void MakeClassAbstract() = 0;
254 struct const_iterator : std::iterator<std::forward_iterator_tag, IECInstancePtr const>
294 virtual void MakeClassAbstract() = 0;
455 virtual void MakeClassAbstract() = 0;
472 virtual void MakeClassAbstract() = 0;
521 bool m_includeBaseProperties;
530 virtual void MakeClassAbstract() = 0;
535 struct const_iterator : std::iterator<std::forward_iterator_tag, const ECPropertyP>
566 struct SearchPathSchemaFileLocater;
579 virtual void MakeClassAbstract() = 0;
938 virtual void MakeClassAbstract() = 0;
1037 return !(*
this == rhs);
1048 template <SchemaMatchType MatchType>
1054 return lhs.Matches (rhs, MatchType);
1059 template <SchemaMatchType MatchType>
1065 return lhs.LessThan (rhs, MatchType);
1085 typedef bpair<SchemaKey, ECSchemaPtr>
MapVal;
1113 BeAssert (WString::npos != schemaAndClassNameSeparatedByColon.find (
':'));
1114 Parse (schemaAndClassNameSeparatedByColon);
1122 size_t pos = schemaAndClassNameSeparatedByColon.find (
':');
1123 if (WString::npos != pos)
1219 struct SchemaMapExact:bmap<SchemaKey, ECSchemaPtr, SchemaKeyLessThan <SCHEMAMATCHTYPE_Exact> >
1249 virtual void MakeClassAbstract() = 0;
1259 virtual void MakeClassAbstract() = 0;
1294 virtual void MakeClassAbstract() = 0;
1334 virtual void MakeClassAbstract() = 0;
1382 virtual void MakeClassAbstract() = 0;
Contains a UTF-8 encoded string.
Definition: WString.h:275
SchemaKey()
Default constructor.
Definition: ECSchema.h:997
bool CanConvertToString(IECTypeAdapterContextCR context) const
WString m_className
Definition: ECSchema.h:1102
SchemaKey & SchemaKeyR
Definition: ECObjects.h:54
uint32_t m_versionMinor
Definition: ECSchema.h:987
ECRelationshipConstraintR GetTarget() const
Gets the constraint at the target end of the relationship.
bool SetCalculatedPropertySpecification(IECInstanceP expressionAttribute)
Sets or removes the CalculatedECPropertySpecification custom attribute associated with this ECPropert...
The in-memory representation of the source and target constraints for an ECRelationshipClass as defin...
Definition: ECSchema.h:864
WStringCR GetInvariantDescription() const
Gets the invariant description for this ECSchema.
SchemaKeyCR GetSchemaKey() const
Returns a SchemaKey fully describing this schema.
bool ConvertFromExpressionType(ECValueR v, IECTypeAdapterContextCR context) const
Converts the value from the value which should be used when evaluating ECExpressions.
iterator find(const key_type &__x)
Definition: stdcxx/bstdmap.h:269
bool ShouldNotBeStored() const
Returns true if and only if the full schema name (including version) represents a standard schema tha...
bool operator()(SchemaKeyCR lhs, SchemaKeyCR rhs) const
Determines whether one SchemaKey is less than the other.
Definition: ECSchema.h:1063
SchemaMatchType m_matchType
Definition: ECSchema.h:1078
Definition: ECObjects.h:315
WString m_schemaName
Definition: ECSchema.h:985
ECObjectsStatus
General purpose result codes.
Definition: ECObjects.h:128
The in-memory representation of an ECProperty as defined by ECSchemaXML.
Definition: ECSchema.h:468
End is the source.
Definition: ECSchema.h:769
bool GetIsPolymorphic() const
Returns true if this constraint can also relate to instances of subclasses of classes applied to the ...
static ECTypeDescriptor CreatePrimitiveArrayTypeDescriptor(PrimitiveType primitiveType)
Creates a TypeDescriptor of an array of the given primitiveType.
bool GetIsStruct() const
Returns whether this class can be used as a struct.
'Referencing' relationships imply no ownership and no cascading deletes when the object on either end...
Definition: ECSchema.h:790
StandaloneECEnablerPtr LocateStandaloneEnabler(SchemaKeyCR schemaKey, WCharCP className)
Given a SchemaKey and a className, tries to locate the StandaloneEnabler for the ECClass.
PrimitiveECPropertyP GetAsPrimitivePropertyP()
Returns the property as a PrimitiveECProperty*.
bmap< SchemaKey, ECSchemaPtr > SchemaMap
Definition: ECSchema.h:1070
ECObjectsStatus SetCardinality(RelationshipCardinalityCR value)
Sets the cardinality of the constraint in the relationship.
bool GetIsArray() const
Returns whether this property is an Array property.
RefCountedPtr< SupplementalSchemaInfo > SupplementalSchemaInfoPtr
Definition: ECSchema.h:1368
int GetCount()
Returns the number of schemas currently in the cache.
WString m_accessString
Definition: ECSchema.h:1176
WString m_className
Definition: ECSchema.h:1175
bool LessThan(SchemaKeyCR rhs, SchemaMatchType matchType) const
Compares two SchemaKeys and returns whether the target schema is less than this SchemaKey, where LessThan is dependent on the match type.
uint32_t GetClassCount() const
Gets the number of classes in the schema.
ECObjectsStatus SetCustomAttribute(IECInstanceR customAttributeInstance)
Adds a custom attribute to the container.
bvector< QualifiedECAccessor > QualifiedECAccessorList
Definition: ECSchema.h:1213
bool Matches(SchemaKeyCR rhs, SchemaMatchType matchType) const
Compares two SchemaKeys and returns whether the target schema matches this SchemaKey, where "matches" is dependent on the match type.
WString const GetRoleLabel() const
Gets the label of the constraint role in the relationship.
bpair< SchemaKey, ECSchemaPtr > MapVal
Definition: ECSchema.h:1085
ECPropertyCP FindByDisplayLabel(WCharCP label) const
Attempts to look up an ECProperty by its display label.
QualifiedECAccessorList const & QualifiedECAccessorListCR
Definition: ECSchema.h:1214
void DebugDump() const
Prints out detailed information about this ECSchema, and then calls Dump() on each ECClass...
StructECProperty const * StructECPropertyCP
Definition: ECObjects.h:59
static bool ClassesAreEqualByName(ECClassCP currentBaseClass, const void *arg)
Given two ECClass's, checks to see if they are equal by name.
void SetSchemaName(WCharCP name)
Sets the name of the schema containing the ECClass.
Definition: ECSchema.h:1192
uint32_t GetVersionMinor() const
Gets the minor version of this schema.
bool GetIsDisplayLabelDefined() const
Whether the display label is explicitly defined or not.
SchemaWriteStatus WriteToXmlFile(WCharCP ecSchemaXmlFile, bool utf16=false)
Serializes an ECXML schema to a file.
SchemaMapExact::const_iterator Find(SchemaKeyCR key, SchemaMatchType matchType) const
Returns an iterator to the entry in this map matching the specified key using the specified match typ...
Definition: ECSchema.h:1222
bool FromString(WCharCP str)
Attempts to initialize this QualifiedECAccessor from a colon-separated string.
static WString FormatSchemaVersion(uint32_t &versionMajor, uint32_t &versionMinor)
Generate a schema version string given the major and minor version values.
static ECObjectsStatus ParseSchemaFullName(WString &schemaName, uint32_t &versionMajor, uint32_t &versionMinor, WCharCP fullName)
Given a version string MM.NN, this will parse other major and minor versions.
ArrayKind GetKind() const
The ArrayKind of this ECProperty.
ECObjectsStatus SetDescription(WStringCR value)
Sets the description for this ECSchema.
Definition: ECSchema.h:1219
static bool DecodeFromValidName(WStringR decoded, WStringCR name)
Decodes special characters in a name encoded by EncodeToValidName() to produce a name suitable for di...
RefCountedPtr< ECSchemaCache > ECSchemaCachePtr
Definition: ECSchema.h:1325
WStringCR GetName() const
Gets the name of the ECProperty.
bool operator==(const_iterator const &rhs) const
Compare iterator to value.
The ECValue holds an array.
Definition: ECObjects.h:307
bool GetIsExplicit() const
Returns true if the constraint is explicit.
ECSchemaReferenceListCR GetReferencedSchemas() const
Gets the other schemas that are used by classes within this schema.
int64_t ECClassId
Definition: ECSchema.h:131
Interface to find a standalone enabler, typically for an embedded ECStruct in an ECInstance.
Definition: ECSchema.h:1291
uint32_t m_checkSum
Definition: ECSchema.h:988
bvector< ECClassP > ECDerivedClassesList
Definition: ECSchema.h:561
ECRelationshipConstraint & ECRelationshipConstraintR
Definition: ECObjects.h:65
bool GetIsFinal() const
Gets whether this class is final and can't be subclassed.
SchemaKey const & SchemaKeyCR
Definition: ECObjects.h:54
Handles validation, encoding, and decoding of names for ECSchemas, ECClasses, and ECProperties...
Definition: ECSchema.h:40
long long int64_t
Definition: Bentley.r.h:94
WStringCR GetInvariantDescription() const
Gets the invariant description for this ECClass.
WString GetTypeName() const
The ECXML typename for the property.
RefCountedPtr< ECSchema > ECSchemaPtr
Definition: ECSchema.h:569
static ECObjectsStatus ParseSchemaFullName(SchemaKey &key, WCharCP schemaFullName)
Given a full schema name (which includes the version information), will return a SchemaKey with the s...
ECObjectsStatus CreateClass(ECClassP &ecClass, WStringCR name)
If the class name is valid, will create an ECClass object and add the new class to the schema...
static ECObjectsStatus CreateSchema(ECSchemaPtr &schemaOut, WStringCR schemaName, uint32_t versionMajor, uint32_t versionMinor)
If the given schemaName is valid, this will create a new schema object.
bool operator==(const_iterator const &rhs) const
Checks for equality.
ECObjectsStatus SetIsPolymorphic(bool value)
Sets whether this constraint can also relate to instances of subclasses of classes applied to the con...
bool IsArray() const
Returns true if the ECProperty is an Array property.
Definition: ECSchema.h:122
ArrayECProperty const * ArrayECPropertyCP
Definition: ECObjects.h:60
wchar_t WChar
Definition: Bentley.h:223
SchemaNameClassNamePair(WStringCR schemaName, WStringCR className)
Constructs a SchemaNameClassNamePair from the specified schema and class names.
Definition: ECSchema.h:1105
Provides Bentley specific set implementation (Bentley/bset.h).
uint32_t GetLowerLimit() const
Returns the lower limit of the cardinality.
bool SupportsUnits() const
Returns true if ECProperties of the extended type handled by this type adapter may have units...
SchemaNameClassNamePair(WStringCR schemaAndClassNameSeparatedByColon)
Constructs a SchemaNameClassNamePair from a string of the format "SCHEMANAME:CLASSNAME".
Definition: ECSchema.h:1111
WString GetFullSchemaName() const
Return full schema name in format GetName().MM.mm where Name is the schema name, MM is major version ...
static RelationshipCardinalityCR ZeroOne()
Returns the shared static RelationshipCardinality object that represents the (0,1) cardinality...
ECObjectsStatus SetMaxOccurs(uint32_t value)
Sets the Maximum number of array members.
uint32_t GetMaxOccurs() const
Gets the Maximum number of array members.
The in-memory representation of a schema as defined by ECSchemaXML.
Definition: ECSchema.h:1375
ECCustomAttributeInstanceIterable GetPrimaryCustomAttributes(bool includeBase) const
Retrieves all custom attributes from the container NOT including supplemental custom attributes...
ECObjectsStatus SetIsFinal(WCharCP isFinal)
Sets the bool value of whether this class is final and can't be subclassed.
IECInstance const * IECInstanceCP
Definition: ECObjects.h:67
The string to check was NULL or empty.
Definition: ECSchema.h:49
ECObjectsStatus SetVersionMajor(uint32_t value)
Sets the major version of this schema.
static uint32_t ComputeSchemaXmlStringCheckSum(WCharCP str, size_t len)
Given a str containing SchemaXml, will compute the CheckSum.
ArrayECProperty * ArrayECPropertyP
Definition: ECObjects.h:60
An object that controls the lifetime of a set of ECSchemas.
Definition: ECSchema.h:1331
ECClassContainer const & ECClassContainerCR
Definition: ECObjects.h:62
Definition: ECSchema.h:761
bvector< ECClassP > ECBaseClassesList
Definition: ECSchema.h:560
static ECSchemaCachePtr Create()
Creates an ECSchemaCachePtr.
struct Bentley::WString const & WStringCR
Definition: Bentley.h:239
Iterates over the custom attribute instances in a container.
Definition: ECSchema.h:233
The ECValue holds a Primitive type.
Definition: ECObjects.h:305
iterator begin()
Definition: stdcxx/bstdmap.h:178
SchemaMatchType
Defines what sort of match should be used when locating a schema.
Definition: ECSchema.h:967
virtual ~ECSchemaCache()
Destructor.
SupplementalSchemaInfoPtr const GetSupplementalInfo() const
Gets the SupplementalSchemaInfo for this ECSchema.
bool IsStandardSchema() const
Returns true if the schema is an ECStandard schema.
WStringCR GetName() const
Returns the name of this ECSchema.
bool operator==(SchemaKeyCR rhs) const
Returns whether this SchemaKey is Identical to the target SchemaKey.
Definition: ECSchema.h:1029
ECObjectsStatus SetStrength(StrengthType value)
Sets the StrengthType of this constraint.
ValueKind GetTypeKind() const
Returns the ValueKind of the ECProperty.
Definition: ECSchema.h:114
bool GetIsDomainClass() const
Gets whether this class can be used as a domain object.
RefCountedPtr< IECInstance > IECInstancePtr
Definition: ECInstance.h:98
IECInstancePtr GetPrimaryCustomAttribute(WStringCR schemaName, WStringCR className) const
Retrieves the custom attribute matching the class name.
int CompareByName(WString schemaName) const
Compares two schema names and returns whether the target schema matches this m_schemaName.
ECPropertyP const & operator*() const
Returns the value at the current location.
StructECPropertyP GetAsStructPropertyP()
Returns the property as a StructECProperty*.
ECObjectsStatus RemoveClass(ECClassCR classConstraint)
Removes the specified class from the constraint.
ECObjectsStatus AddBaseClass(ECClassCR baseClass)
Adds a base class You cannot add a base class if it creates a cycle.
Definition: ECSchema.h:762
ValueKind
Represents the classification of the data type of an ECValue.
Definition: ECObjects.h:302
The ECValue holds a struct.
Definition: ECObjects.h:306
const_iterator & operator++()
Increment the iterator.
void Sprintf(WCharCP format,...)
Replace the contents of this string with a formatted result.
ECSchemaPtr LocateSchema(SchemaKeyR key, SchemaMatchType matchType, ECSchemaReadContextR schemaContext)
Tries to locate the requested schema.
Definition: ECSchema.h:1075
StrengthType
The various strengths supported on a relationship class.
Definition: ECSchema.h:784
SchemaNameClassNamePair()
Constructs an empty SchemaNameClassNamePair.
Definition: ECSchema.h:1109
ECClassId GetId() const
Return unique id (May return 0 until it has been explicitly set by ECDb or a similar system) ...
SchemaMapExact ECSchemaReferenceList
Definition: ECSchema.h:1239
Definition: ECSchema.h:526
ECObjectsStatus SetName(WStringCR value)
Sets the name of this schema.
static bool IsValidAlphaNumericCharacter(WChar c)
Checks whether a character is valid for use in an ECName, e.g. alphanumeric, plus '_'...
iterator end()
Definition: stdcxx/bstdmap.h:186
WStringCR GetDisplayLabel() const
Gets the DisplayLabel for this ECSchema.
bool Parse(WStringCR schemaAndClassNameSeparatedByColon)
Attempts to populate this SchemaNameClassNamePair from a string of the format "SCHEMANAME:CLASSNAME"...
Definition: ECSchema.h:1120
void FindAllSchemasInGraph(bvector< ECN::ECSchemaCP > &allSchemas, bool includeRootSchema=true) const
Find all ECSchemas in the schema graph, avoiding duplicates and any cycles.
ECSchema * ECSchemaP
Definition: ECObjects.h:53
bool GetIsStruct() const
Returns whether this property is a Struct property.
ECObjectsStatus SetNamespacePrefix(WStringCR value)
Sets the namespace prefix for this ECSchema.
ArrayKind
Represents the classification of the data type of an EC array element.
Definition: ECObjects.h:313
bool IsSupplementalSchema() const
Indicates whether this schema is a supplemental schema or not.
ECObjectsStatus CreateStructProperty(StructECPropertyP &ecProperty, WStringCR name)
If the given name is valid, creates a struct property object using the current class as the struct ty...
WStringCR GetDisplayLabel() const
Gets the Display Label for this ECProperty. If no label has been set explicitly, it will return the N...
bool IsDefined(WStringCR schemaName, WStringCR className) const
Returns true if the container has a custom attribute of a class of the specified name.
ECRelatedInstanceDirection GetStrengthDirection() const
Gets the StrengthDirection (either Forward or Backward) of this constraint.
StructECProperty * StructECPropertyP
Definition: ECObjects.h:59
RelationshipCardinality()
Default constructor. Creates a cardinality of (0, 1)
Identifies an ECProperty by schema name, class name, and access string.
Definition: ECSchema.h:1171
Definition: ECSchema.h:763
Determines whether one SchemaKey is less than the other.
Definition: ECSchema.h:1060
Definition: ECSchema.h:244
Legacy behavior.
Definition: ECObjects.h:269
The in-memory representation of a relationship class as defined by ECSchemaXML.
Definition: ECSchema.h:934
End is the target.
Definition: ECSchema.h:770
StrengthType GetStrength() const
Gets the StrengthType of this constraint.
QualifiedECAccessor()
Constructs an empty QualifiedECAccessor.
Definition: ECSchema.h:1179
IECSchemaLocater & GetSchemaLocater()
Returns the SchemaCache as an IECSchemaLocater.
ECValue const & ECValueCR
Definition: ECObjects.h:46
ECObjectsStatus SetType(ECClassCR value)
The property type.
ArrayECPropertyCP GetAsArrayProperty() const
Returns the property as a const ArrayECProperty*.
ECClassCR GetClass() const
Returns the name of the ECClass that this property is contained within.
WStringCR GetName() const
The name of this ECClass.
Fully defines a schema with its name, major and minor versions, and a checksum.
Definition: ECSchema.h:983
The in-memory representation of an ECProperty as defined by ECSchemaXML.
Definition: ECSchema.h:486
ECObjectsStatus CopyTo(ECRelationshipConstraintR toRelationshipConstraint)
Copies this constraint to the destination.
StructECPropertyCP GetAsStructProperty() const
Returns the property as a const StructECProperty*.
static ECSchemaPtr LocateSchema(SchemaKeyR schema, ECSchemaReadContextR schemaContext)
Locate a schema using the provided schema locators and paths.
wchar_t const * WCharCP
Definition: Bentley.h:224
Interface implemented by class that provides schema location services.
Definition: ECSchema.h:1310
ECObjectsStatus RemoveBaseClass(ECClassCR baseClass)
Removes a base class.
bool FromAccessString(ECN::ECEnablerCR rootEnabler, WCharCP accessString)
Attempts to initialize this QualifiedECAccessor from an access string identifying a property of the s...
Container holding ECProperties that supports STL like iteration.
Definition: ECSchema.h:515
ECObjectsStatus SetIsCustomAttributeClass(WCharCP isCustomAttribute)
Sets the bool value of whether this class can be used as a custom attribute.
WString const GetInvariantRoleLabel() const
Gets the invariant label of the constraint role in the relationship.
Find latest version.
Definition: ECSchema.h:976
bool IsRoleLabelDefined() const
Returns whether the RoleLabel has been set explicitly.
bool operator!=(const_iterator const &rhs) const
Checks for inequality.
IECInstancePtr GetCustomAttribute(WStringCR schemaName, WStringCR className) const
Retrieves the custom attribute matching the class name.
ECSchema const & ECSchemaCR
Definition: ECObjects.h:53
bvector< ECClassP > ECConstraintClassesList
Definition: ECSchema.h:562
Iterator for the custom attribute instances.
Definition: ECSchema.h:254
IECInstance * IECInstanceP
Definition: ECObjects.h:67
ECPropertyCP GetBaseProperty() const
Gets the base property, if any, that this ECProperty inherits from.
bvector< IECInstancePtr > ECCustomAttributeCollection
Definition: ECSchema.h:135
#define NULL
Definition: Bentley.h:157
PrimitiveType GetType() const
Gets the PrimitiveType of this ECProperty.
OrderIdStorageMode GetOrderIdStorageMode() const
Returns the storage mode of the OrderId for this contraint.
SchemaReadStatus
Result status for deserializing an ECSchema from Xml.
Definition: ECObjects.h:175
bool GetUnits(UnitSpecR unit, IECTypeAdapterContextCR context) const
If SupportsUnits() returns true, this method is called to obtain the units for a specific ECProperty...
Find exact VersionMajor, VersionMinor match as well as Data.
Definition: ECSchema.h:970
WStringCR GetInvariantDisplayLabel() const
Gets the invariant display label for this ECClass.
bool IsStruct() const
Returns true if the ECProperty is a Struct property.
Definition: ECSchema.h:120
ECSchema const * ECSchemaCP
Definition: ECObjects.h:53
#define ECOBJECTS_EXPORT
Definition: ECObjects.h:20
Definition: ECSchema.h:1266
bool operator==(const_iterator const &rhs) const
Checks for equality.
ECPropertyId GetId() const
Return unique id (May return 0 until it has been explicitly set by ECDb or a similar system) ...
static ECObjectsStatus ParseVersionString(uint32_t &versionMajor, uint32_t &versionMinor, WCharCP versionString)
Given a version string MM.NN, this will parse other major and minor versions.
ArrayKind GetArrayKind() const
Returns the ArrayKind of the ECProperty, if the ECProperty is an array property.
Definition: ECSchema.h:116
ECObjectsStatus AddClass(ECClassCR classConstraint)
Adds the specified class to the constraint.
ECSchemaReadContext & ECSchemaReadContextR
Definition: ECObjects.h:55
void SetAccessString(WCharCP acStr)
Sets the access string identifying the ECProperty within the ECClass.
Definition: ECSchema.h:1196
Definition: ECSchema.h:1255
bool IsSamePrimarySchema(ECSchemaR primarySchema) const
Returns true if the passed in schema is the same base schema as the current schema.
PrimitiveType
Enumeration of primitive datatypes supported by native "ECObjects" implementation.
Definition: ECObjects.h:322
static SchemaReadStatus ReadFromXmlString(ECSchemaPtr &schemaOut, Utf8CP ecSchemaXml, ECSchemaReadContextR schemaContext)
Reads an ECSchema from a UTF-8 encoded ECSchemaXML-formatted string.
const ECConstraintClassesList & GetClasses() const
Returns the classes applied to the constraint.
void SetImmutable()
Set the schema to be immutable. Immutable schema cannot be modified.
WString substr(size_type __pos=0, size_type __n=npos) const
Get a substring.
Definition: WString.h:156
IECInstancePtr GetCustomAttributeLocal(WStringCR schemaName, WStringCR className) const
Retrieves the custom attribute matching the class name.
virtual ~ECRelationshipConstraint()
Destructor.
size_t GetPropertyCount(bool includeBaseProperties=true) const
Returns the number of ECProperties in this class.
const_iterator end() const
Returns the end of the collection.
SchemaWriteStatus
Result status for serializing an ECSchema to Xml.
Definition: ECObjects.h:187
int64_t ECSchemaId
Definition: ECSchema.h:133
const_iterator begin() const
Returns the beginning of the collection.
bool operator==(SchemaNameClassNamePair const &rhs) const
Performs equality comparison against another SchemaNameClassNamePair.
Definition: ECSchema.h:1150
const_iterator end() const
Returns the end of the collection.
PrimitiveType GetPrimitiveElementType() const
Gets the PrimitiveType if this ArrayProperty contains PrimitiveType elements.
The string contains invalid characters.
Definition: ECSchema.h:51
ECObjectsStatus SetStructElementType(ECClassCP value)
Sets the ECClass to be used for the array's struct elements.
SchemaWriteStatus WriteToXmlStream(IStreamP ecSchemaXmlStream, bool utf16=false)
Writes an ECXML schema to an IStream.
ECObjectsStatus CopyClass(ECClassP &targetClass, ECClassCR sourceClass)
Given a source class, will copy that class into this schema if it does not already exist...
ECObjectsStatus CreateArrayProperty(ArrayECPropertyP &ecProperty, WStringCR name)
If the given name is valid, creates an array property object using the current class as the array typ...
Determines whether two SchemaKeys match.
Definition: ECSchema.h:1049
WStringCR GetDescription() const
Gets the description for this ECSchema. Returns the localized description if one exists.
bool GetIsPrimitive() const
Returns whether this property is a Primitive property.
bvector< WString > StandardValuesCollection
Definition: ECSchema.h:292
void SetClassName(WCharCP name)
Sets the name of the ECClass (or subclass thereof) containing the ECProperty.
Definition: ECSchema.h:1194
ECPropertyP GetPropertyP(WCharCP name, bool includeBaseClasses=true) const
Get a property by name within the context of this class and its base classes.
ECObjectsStatus SetMinOccurs(uint32_t value)
Sets the Minimum number of array members.
ValidationResult
Enumeration defining the result of a validation check.
Definition: ECSchema.h:46
bool ConvertToExpressionType(ECValueR v, IECTypeAdapterContextCR context) const
Converts the value to the value which should be used when evaluating ECExpressions.
ECObjectsStatus CopySchema(ECSchemaPtr &schemaOut) const
Copies this schema.
ECObjectsStatus SetType(PrimitiveType value)
Sets the PrimitiveType of this ECProperty. The default type is PRIMITIVETYPE_String.
ECClassP const & operator*() const
Returns the value at the current location.
ECSchemaP GetSchema(SchemaKeyCR key)
Get the requested schema from the cache.
bool GetIsReadOnly() const
Gets whether this ECProperty's value is read only.
ECN::IECInstancePtr PopulateDefaultFormatterProperties(ECN::IECInstanceCR formatter) const
Given an instance containing custom formatting options, replace any null properties with their defaul...
const ECDerivedClassesList & GetDerivedClasses() const
Returns a list of the classes that derive from this class.
static const uint32_t COMPONENT_INDEX_None
Definition: ECSchema.h:281
ECObjectsStatus AddSchema(ECSchemaR schema)
Adds a schema to the cache.
ECRelationshipClass const * ECRelationshipClassCP
Definition: ECObjects.h:64
const_iterator & operator++()
Increments the iterator.
bool HasStandardValues() const
PrimitiveECPropertyCP GetAsPrimitiveProperty() const
Returns the property as a const PrimitiveECProperty*.
WStringCR GetInvariantDescription() const
Gets the invariant description for this ECProperty.
ArrayKind m_arrayKind
Definition: ECSchema.h:89
ECObjectsStatus GetOrderedRelationshipPropertyName(WString &propertyName, ECRelationshipEnd end) const
Returns pointer to ECRelationshipClassP, used to avoid dynamic_cast.
ECRelationshipClass * ECRelationshipClassP
Definition: ECObjects.h:64
WCharCP GetAccessString() const
Returns the access string identifying the ECProperty within the ECClass.
Definition: ECSchema.h:1189
WStringCR GetDisplayLabel() const
Gets the display label of this ECClass. If no display label has been set explicitly, it will return the name of the ECClass.
uint32_t m_versionMajor
Definition: ECSchema.h:986
bool GetIsMultiple() const
Returns true if the constraint allows for a variable number of classes.
const_iterator & operator++()
Increments the iterator.
ECRelationshipClassP GetRelationshipClassP()
Used to avoid dynamic_cast.
Related instance is the source in the relationship instance.
Definition: ECSchema.h:780
static SchemaReadStatus ReadFromXmlStream(ECSchemaPtr &schemaOut, IStreamP ecSchemaXmlStream, ECSchemaReadContextR schemaContext)
Writes an ECSchema from an ECSchemaXML-formatted string in an IStream.
ECSchemaCP FindSchema(SchemaKeyCR schema, SchemaMatchType matchType) const
Returns this if the name matches, otherwise searches referenced ECSchemas for one whose name matches ...
bool GetIsOrdered() const
Returns true if the constraint is ordered. This is determined by seeing if the custom attribute signi...
ECObjectsStatus CreatePrimitiveProperty(PrimitiveECPropertyP &ecProperty, WStringCR name)
If the given name is valid, creates a primitive property object with the default type of STRING...
SchemaKeyMatchPredicate(SchemaKeyCR key, SchemaMatchType matchType)
Constructs a SchemaKeyMatchPredicate.
Definition: ECSchema.h:1083
ECObjectsStatus RemoveProperty(WStringCR name)
Remove the named property.
virtual ECSchemaPtr _LocateSchema(SchemaKeyR key, SchemaMatchType matchType, ECSchemaReadContextR schemaContext)=0
Tries to locate the requested schema.
bool operator!=(const_iterator const &rhs) const
Checks for inequality.
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
bool HasBaseClasses() const
Returns whether there are any base classes for this class.
ECPropertyIterable GetProperties() const
Returns an iterable of all the ECProperties defined on this class.
ECClass const * ECClassCP
Definition: ECObjects.h:63
WString m_schemaName
Definition: ECSchema.h:1101
WCharCP GetSchemaName() const
Returns the name of the schema containing the ECClass.
Definition: ECSchema.h:1185
ECSchemaId GetId() const
Return unique id (May return 0 until it has been explicitly set by ECDb or a similar system) ...
IECInstance const & IECInstanceCR
Definition: ECObjects.h:67
bool operator!=(const_iterator const &rhs) const
Compare iterator to value.
ECObjectsStatus SetDisplayLabel(WStringCR value)
Sets the display label of this ECClass.
EvaluationOptions
Options to be used when evaluating an ECExpression.
Definition: ECObjects.h:261
ECObjectsStatus SetIsStruct(WCharCP isStruct)
Sets the bool value of whether this class can be used as a struct.
int64_t ECPropertyId
Definition: ECSchema.h:132
bool IsCalculated() const
Returns true if this ECProperty has a CalculatedECPropertySpecification custom attribute applied to i...
static RelationshipCardinalityCR ZeroMany()
Returns the shared static RelationshipCardinality object that represents the (0,n) cardinality...
bool IsPrimitive() const
Returns true if the ECProperty is a Primitive property.
Definition: ECSchema.h:118
bool ConvertFromString(ECValueR v, WCharCP str, IECTypeAdapterContextCR context) const
Converts from a string to the underlying ECValue type.
static bool IsValidName(WCharCP name)
Returns true if the specified name is a valid EC name.
uint32_t GetUpperLimit() const
Returns the upper limit of the cardinality.
ECRelationshipEnd
Used to define which end of the relationship, source or target.
Definition: ECSchema.h:767
ECObjectsStatus SetDescription(WStringCR value)
Sets the description for this ECProperty.
ECClass const & ECClassCR
Definition: ECObjects.h:63
ECSchema & ECSchemaR
Definition: ECObjects.h:53
ECObjectsStatus SetBaseProperty(ECPropertyCP value)
Sets the base property that this ECProperty inherits from.
WString ToColonSeparatedString() const
Concatenates the schema and class names into a single colon-separated string of the format "SCHEMANAM...
Definition: ECSchema.h:1157
The in-memory representation of an ECProperty as defined by ECSchemaXML.
Definition: ECSchema.h:451
#define DEFAULT_VERSION_MAJOR
Definition: ECSchema.h:18
SchemaKey(WCharCP name, uint32_t major, uint32_t minor)
Creates a new SchemaKey with the given name and version information.
Definition: ECSchema.h:994
WCharCP GetFullName() const
{SchemaName}:{ClassName} The pointer will remain valid as long as the ECClass exists.
ECObjectsStatus SetVersionMinor(uint32_t value)
Sets the minor version of this schema.
ECProperty const * ECPropertyCP
Definition: ECObjects.h:56
ECObjectsStatus CreateRelationshipClass(ECRelationshipClassP &relationshipClass, WStringCR name)
If the class name is valid, will create an ECRelationshipClass object and add the new class to the sc...
const_iterator end() const
Returns the end of the iterator.
uint32_t GetMinOccurs() const
Gets the Minimum number of array members.
StandaloneECEnabler * StandaloneECEnablerP
Definition: ECSchema.h:568
int CompareTo(WCharCP other) const
Perform a (case-sensitive) comparison.
Definition: WString.h:163
'Holding' relationships imply shared ownership.
Definition: ECSchema.h:795
ECClassP FindClassP(ECN::SchemaNameClassNamePair const &classNamePair) const
Get a class by name within the context of this list.
bool GetIsOrdered() const
Returns whether the relationship is ordered on this constraint.
#define DEFINE_T_SUPER(B)
Definition: Bentley.h:167
IECCustomAttributeContainer & GetCustomAttributeContainer()
Get the IECCustomAttributeContainer holding this schema's custom attributes.
bool ConvertToString(WStringR str, ECValueCR v, IECTypeAdapterContextCR context, IECInstanceCP formatter=0) const
Converts the ECValue to a display string.
ECRelatedInstanceDirection
Used to describe the direction of a related instance within the context of an IECRelationshipInstance...
Definition: ECSchema.h:775
static RelationshipCardinalityCR OneOne()
Returns the shared static RelationshipCardinality object that represents the (1,1) cardinality...
RefCountedPtr< SearchPathSchemaFileLocater > SearchPathSchemaFileLocaterPtr
Definition: ECSchema.h:570
ECClassCR GetType() const
Gets the ECClass that defines the type for this property.
const ECSchemaReferenceList & ECSchemaReferenceListCR
Definition: ECSchema.h:1240
const_iterator begin() const
Returns the beginning of the collection.
IECCustomAttributeContainer const & IECCustomAttributeContainerCR
Definition: ECObjects.h:71
bool IsPrimitiveArray() const
Returns true if the ECProperty is an Array property, and the array elements are Primitives.
Definition: ECSchema.h:124
bool IsSupplemented() const
Returns true if the schema is a supplemented schema.
OrderIdStorageMode
Used to define how the relationship OrderId is handled.
Definition: ECSchema.h:759
bool GetIsCustomAttributeClass() const
Returns whether this class can be used as a custom attribute.
IECInstancePtr const & operator*() const
Return the IECInstance at the iterator location.
static bool EncodeToValidName(WStringR encoded, WStringCR name)
Encodes special characters in a possibly invalid name to produce a valid name.
IECTypeAdapterContext const & IECTypeAdapterContextCR
Definition: ECObjects.h:98
ECObjectsStatus DropSchema(SchemaKeyCR key)
Removes the specified schema from the cache.
bool RemoveCustomAttribute(WStringCR schemaName, WStringCR className)
Removes a custom attribute from the container.
bool operator()(SchemaKeyCR lhs, SchemaKeyCR rhs) const
Determines whether two SchemaKeys match.
Definition: ECSchema.h:1052
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
This class describes the cardinality of a relationship.
Definition: ECSchema.h:811
PrimitiveECProperty const * PrimitiveECPropertyCP
Definition: ECObjects.h:57
Find exact VersionMajor, VersionMinor match.
Definition: ECSchema.h:972
Definition: ECObjects.h:316
static ECTypeDescriptor CreateStructTypeDescriptor()
Creates a TypeDescriptor for a struct.
ECN::IECInstancePtr CreateDefaultFormatter(bool includeAllValues, bool forDwg=false) const
Create an IECInstance representing default formatting options for converting to string.
ECObjectsStatus SetTypeName(WString value)
Sets the ECXML typename for the property.
Utf8Char const * Utf8CP
Definition: Bentley.h:229
ECProperty * ECPropertyP
Definition: ECObjects.h:56
ECSchemaCache & ECSchemaCacheR
Definition: ECObjects.h:73
static SchemaReadStatus ReadFromXmlFile(ECSchemaPtr &schemaOut, WCharCP ecSchemaXmlFile, ECSchemaReadContextR schemaContext)
Writes an ECSchema from an ECSchemaXML-formatted file.
ECObjectsStatus SetStrengthDirection(ECRelatedInstanceDirection value)
Sets the StrengthDirection (either Forward or Backward) of this constraint.
ECCustomAttributeInstanceIterable GetCustomAttributes(bool includeBase) const
Retrieves all custom attributes from the container including supplemental custom attributes.
static RelationshipCardinalityCR OneMany()
Returns the shared static RelationshipCardinality object that represents the (1,n) cardinality...
ECRelationshipClassCP GetRelationshipClassCP() const
Used to avoid dynamic_cast.
bool operator<(SchemaNameClassNamePair other) const
Performs a less-than comparison against another SchemaNameClassNamePair.
Definition: ECSchema.h:1136
ECObjectsStatus SetIsReadOnly(bool value)
Sets whether this ECProperty's value is read only.
RelationshipCardinalityCR GetCardinality() const
Gets the cardinality of the constraint in the relationship.
ECN::IECInstancePtr CondenseFormatterForSerialization(ECN::IECInstanceCR formatter) const
Given an instance representing formatting options, returns a copy of the instance optimized for seria...
bool operator!=(SchemaKeyCR rhs) const
Returns true if the target SchemaKey is not Identical to this SchemaKey, false otherwise.
Definition: ECSchema.h:1035
const_iterator begin() const
Returns the beginning of the iterator.
ECClassCP GetClassCP(WCharCP name) const
Get a class by name within the context of this schema.
bool RequiresExpressionTypeConversion(EvaluationOptions evalOptions=EVALOPT_Legacy) const
ECObjectsStatus SetIsDomainClass(WCharCP isDomainClass)
Sets the bool value of whether this class can be used as a domain object.
#define DEFAULT_VERSION_MINOR
Definition: ECSchema.h:19
bool IsTreatedAsString() const
Indicates if the value is intended to be interpreted as a string by the user, regardless of the under...
ECClassCP GetStructElementType() const
Gets the ECClass of the array's struct elements.
static ECTypeDescriptor CreateStructArrayTypeDescriptor()
Creates a TypeDescriptor for a struct array type.
PrimitiveECProperty * PrimitiveECPropertyP
Definition: ECObjects.h:57
ECSchemaCR GetSchema() const
The ECSchema that this class is defined in.
SchemaWriteStatus WriteToXmlString(WStringR ecSchemaXml) const
Serializes an ECXML schema to a string.
static ECObjectsStatus ParseClassName(WStringR prefix, WStringR className, WStringCR qualifiedClassName)
Given a qualified class name, will parse out the schema's namespace prefix and the class name...
WString ToString() const
Returns a colon-separated string of the format "Schema:Class:AccessString".
ECObjectsStatus GetOrderedRelationshipPropertyName(WString &propertyName) const
Gets the name of the OrderId property for this constraint.
ECTypeDescriptor(PrimitiveType primitiveType)
Constructor that takes a PrimitiveType.
Definition: ECSchema.h:110
ECObjectsStatus ResolveNamespacePrefix(ECSchemaCR schema, WStringR namespacePrefix) const
Resolve a namespace prefix for the specified schema within the context of this schema and its referen...
ECValue & ECValueR
Definition: ECObjects.h:46
#define BeAssert(_Expression)
BeAssert performs the same function as the standard assert, plus it prevents the most common cases of...
Definition: BeAssert.h:56
Related instance is the target in the relationship instance.
Definition: ECSchema.h:778
ECObjectsStatus RemoveReferencedSchema(ECSchemaR refSchema)
Removes an ECSchema from the list of referenced schemas.
The name is valid.
Definition: ECSchema.h:48
ECEnabler const & ECEnablerCR
Definition: ECObjects.h:78
static void SetErrorHandling(bool showMessages, bool doAssert)
Used for debugging purposes.
WStringCR GetDescription() const
Gets the description of this ECClass. Returns the localized description if one exists.
RefCountedPtr< ECRelationshipClass > ECRelationshipClassPtr
Definition: ECSchema.h:964
WCharCP GetClassName() const
Returns the name of the ECClass (or subclass thereof) containing the ECProperty.
Definition: ECSchema.h:1187
void Clear()
Removes all schemas from the cache.
Container for information about supplemental schemas.
Definition: SupplementalSchema.h:383
ECObjectsStatus SetDisplayLabel(WStringCR value)
Sets the Display Label for this ECProperty.
RelationshipCardinality const & RelationshipCardinalityCR
Definition: ECObjects.h:66
WString m_schemaName
Definition: ECSchema.h:1174
unsigned int uint32_t
Definition: Bentley.r.h:93
ECClass * ECClassP
Definition: ECObjects.h:63
Interface adopted by a container object which can hold custom attributes, such as those associated wi...
Definition: ECSchema.h:145
Iterator over the properties.
Definition: ECSchema.h:535
ECObjectsStatus SetDisplayLabel(WStringCR value)
Sets the display label for this ECSchema.
PrimitiveType GetPrimitiveType() const
Returns the primitive type of the ECProperty, if the property is a Primitive type.
Definition: ECSchema.h:128
WStringCR GetInvariantDisplayLabel() const
Gets the invariant display label for this ECSchema.
static WString GetQualifiedClassName(ECSchemaCR primarySchema, ECClassCR ecClass)
Given a schema and a class, will return the fully qualified class name.
ArrayECPropertyP GetAsArrayPropertyP()
Returns the property as an ArrayECProperty*.
Definition: ECSchema.h:1098
Used to represent the type of an ECProperty.
Definition: ECSchema.h:82
ECSchemaCP GetSchemaByNamespacePrefixP(WStringCR namespacePrefix) const
Get a schema by namespace prefix within the context of this schema and its referenced schemas...
bool IsStructArray() const
Returns true if the ECProperty is an Array property, and the array elements are Structs.
Definition: ECSchema.h:126
PrimitiveType m_primitiveType
Definition: ECSchema.h:90
ECRelationshipConstraintR GetSource() const
Gets the constraint at the source end of the relationship.
StandaloneECEnablerP GetDefaultStandaloneEnabler() const
Returns the StandaloneECEnabler for this class.
WStringCR GetInvariantDisplayLabel() const
Gets the invariant display label for this ECSchema.
RefCountedPtr< IECTypeAdapterContext > IECTypeAdapterContextPtr
Definition: ECSchema.h:284
ECEnabler for standalone ECInstances (IECInstances not tied to a specific persistent store) ...
Definition: StandaloneECInstance.h:103
EC_TYPEDEFS(QualifiedECAccessor)
ECObjectsStatus SetPrimitiveElementType(PrimitiveType value)
Sets the PrimitiveType if this ArrayProperty contains PrimitiveType elements.
struct IStream * IStreamP
Definition: ECObjects.h:114
WString ToString() const
Converts the cardinality to a string, for example "(0,n)", "(1,1)".
bool operator()(MapVal const &rhs)
Performs comparison against a MapVal.
Definition: ECSchema.h:1089
bool operator<(SchemaKeyCR rhs) const
Returns whether this SchemaKey's checksum is less than the target SchemaKey's.
Definition: ECSchema.h:1041
bool Is(ECClassCP targetClass) const
Returns true if the class is the type specified or derived from it.
size_t GetSchemas(bvector< ECSchemaP > &schemas) const
uint32_t GetVersionMajor() const
Gets the major version of this schema.
The in-memory representation of an ECClass as defined by ECSchemaXML.
Definition: ECSchema.h:576
ECObjectsStatus SetRoleLabel(WStringCR value)
Sets the label of the constraint role in the relationship.
The in-memory representation of an ECProperty as defined by ECSchemaXML.
Definition: ECSchema.h:377
QualifiedECAccessor(WCharCP schemaName, WCharCP className, WCharCP accessString)
Constructs a QualifiedECAccessor referring to a property of an ECClass specified by access string...
Definition: ECSchema.h:1181
ECObjectsStatus SetDescription(WStringCR value)
Sets the description of this ECClass.
ECSchemaP FindSchemaP(SchemaKeyCR schema, SchemaMatchType matchType)
Returns this if the name matches, otherwise searches referenced ECSchemas for one whose name matches ...
bool GetIsDisplayLabelDefined() const
Returns whether the DisplayLabel is explicitly set.
'Embedding' relationships imply exclusive ownership and cascading deletes.
Definition: ECSchema.h:801
static bool IsSchemaReferenced(ECSchemaCR thisSchema, ECSchemaCR potentiallyReferencedSchema)
Given two schemas, will check to see if the second schema is referenced by the first schema...
bool GetIsDisplayLabelDefined() const
Returns true if the display label has been set explicitly for this schema or not. ...
const ECBaseClassesList & GetBaseClasses() const
Returns a list of the classes this ECClass is derived from.
IECInstance & IECInstanceR
Definition: ECObjects.h:67
static ECTypeDescriptor CreatePrimitiveTypeDescriptor(PrimitiveType primitiveType)
Creates a TypeDescriptor for the given primitiveType.
static ValidationResult Validate(WCharCP name)
Checks a name against the rules for valid names.
ECObjectsStatus AddReferencedSchema(ECSchemaR refSchema)
Adds an ECSchema as a referenced schema in this schema.
ECClassContainerCR GetClasses() const
Returns an iterable container of ECClasses sorted by name. For unsorted called overload.
WStringCR GetNamespacePrefix() const
Gets the namespace prefix for this ECSchema.
SchemaNameClassNamePair(WCharCP schemaName, WCharCP className)
Constructs a SchemaNameClassNamePair from the specified schema and class names.
Definition: ECSchema.h:1107
SchemaKeyCR m_key
Definition: ECSchema.h:1077
ECClassP GetClassP(WCharCP name)
Get a class by name within the context of this schema.
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
UnitSpec & UnitSpecR
Definition: ECObjects.h:102
unsigned char uint8_t
Definition: Bentley.r.h:89
WStringCR GetDescription() const
The Description of this ECProperty. Returns the localized description if one exists.
bool IsUpperLimitUnbounded() const
Indicates if the cardinality is unbound (ie, upper limit is equal to "n")
bool CanConvertFromString(IECTypeAdapterContextCR context) const
Find latest version with matching VersionMajor and VersionMinor that is equal or greater.
Definition: ECSchema.h:974
The string begins with a digit.
Definition: ECSchema.h:50
Supports STL like iterator of classes in a schema.
Definition: ECSchema.h:1246
The SupplementedSchemaBuilder merges ECCustomAttributes from multiple schemas into one combined Schem...
Definition: SupplementalSchema.h:244
RefCountedPtr< StandaloneECEnabler > StandaloneECEnablerPtr
Definition: ECSchema.h:566