Public Member Functions | Static Public Member Functions | List of all members
ECSchema Struct Referenceabstract

The in-memory representation of a schema as defined by ECSchemaXML. More...

#include <ECSchema.h>

Inheritance diagram for ECSchema:
RefCountedBase RefCounted< IRefCounted > IRefCounted

Public Member Functions

SchemaKeyCR GetSchemaKey () const
 Returns a SchemaKey fully describing this schema. More...
 
void DebugDump () const
 Prints out detailed information about this ECSchema, and then calls Dump() on each ECClass. More...
 
ECSchemaId GetId () const
 Return unique id (May return 0 until it has been explicitly set by ECDb or a similar system) More...
 
ECObjectsStatus SetName (WStringCR value)
 Sets the name of this schema. More...
 
WStringCR GetName () const
 Returns the name of this ECSchema. More...
 
ECObjectsStatus SetNamespacePrefix (WStringCR value)
 Sets the namespace prefix for this ECSchema. More...
 
WStringCR GetNamespacePrefix () const
 Gets the namespace prefix for this ECSchema. More...
 
ECObjectsStatus SetDescription (WStringCR value)
 Sets the description for this ECSchema. More...
 
WStringCR GetDescription () const
 Gets the description for this ECSchema. Returns the localized description if one exists. More...
 
WStringCR GetInvariantDescription () const
 Gets the invariant description for this ECSchema. More...
 
ECObjectsStatus SetDisplayLabel (WStringCR value)
 Sets the display label for this ECSchema. More...
 
WStringCR GetDisplayLabel () const
 Gets the DisplayLabel for this ECSchema. More...
 
WStringCR GetInvariantDisplayLabel () const
 Gets the invariant display label for this ECSchema. More...
 
ECObjectsStatus SetVersionMajor (uint32_t value)
 Sets the major version of this schema. More...
 
uint32_t GetVersionMajor () const
 Gets the major version of this schema. More...
 
ECObjectsStatus SetVersionMinor (uint32_t value)
 Sets the minor version of this schema. More...
 
uint32_t GetVersionMinor () const
 Gets the minor version of this schema. More...
 
ECClassContainerCR GetClasses () const
 Returns an iterable container of ECClasses sorted by name. For unsorted called overload. More...
 
uint32_t GetClassCount () const
 Gets the number of classes in the schema. More...
 
bool GetIsDisplayLabelDefined () const
 Returns true if the display label has been set explicitly for this schema or not. More...
 
bool IsStandardSchema () const
 Returns true if the schema is an ECStandard schema. More...
 
bool IsSamePrimarySchema (ECSchemaR primarySchema) const
 Returns true if the passed in schema is the same base schema as the current schema. More...
 
bool IsSupplementalSchema () const
 Indicates whether this schema is a supplemental schema or not. More...
 
bool IsSupplemented () const
 Returns true if the schema is a supplemented schema. More...
 
SupplementalSchemaInfoPtr const GetSupplementalInfo () const
 Gets the SupplementalSchemaInfo for this ECSchema. More...
 
bool ShouldNotBeStored () const
 Returns true if and only if the full schema name (including version) represents a standard schema that should never be stored persistently in a repository (we expect it to be found elsewhere) More...
 
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. More...
 
ECObjectsStatus CreateRelationshipClass (ECRelationshipClassP &relationshipClass, WStringCR name)
 If the class name is valid, will create an ECRelationshipClass object and add the new class to the schema. More...
 
ECSchemaCP GetSchemaByNamespacePrefixP (WStringCR namespacePrefix) const
 Get a schema by namespace prefix within the context of this schema and its referenced schemas. More...
 
ECObjectsStatus ResolveNamespacePrefix (ECSchemaCR schema, WStringR namespacePrefix) const
 Resolve a namespace prefix for the specified schema within the context of this schema and its references. More...
 
ECClassCP GetClassCP (WCharCP name) const
 Get a class by name within the context of this schema. More...
 
ECClassP GetClassP (WCharCP name)
 Get a class by name within the context of this schema. More...
 
ECSchemaReferenceListCR GetReferencedSchemas () const
 Gets the other schemas that are used by classes within this schema. More...
 
ECObjectsStatus AddReferencedSchema (ECSchemaR refSchema)
 Adds an ECSchema as a referenced schema in this schema. More...
 
ECObjectsStatus AddReferencedSchema (ECSchemaR refSchema, WStringCR prefix)
 Adds an ECSchema as a referenced schema in this schema. More...
 
ECObjectsStatus RemoveReferencedSchema (ECSchemaR refSchema)
 Removes an ECSchema from the list of referenced schemas. More...
 
SchemaWriteStatus WriteToXmlString (WStringR ecSchemaXml) const
 Serializes an ECXML schema to a string. More...
 
SchemaWriteStatus WriteToXmlString (Utf8StringR ecSchemaXml) const
 Serializes an ECXML schema to a string. More...
 
SchemaWriteStatus WriteToXmlFile (WCharCP ecSchemaXmlFile, bool utf16=false)
 Serializes an ECXML schema to a file. More...
 
SchemaWriteStatus WriteToXmlStream (IStreamP ecSchemaXmlStream, bool utf16=false)
 Writes an ECXML schema to an IStream. More...
 
WString GetFullSchemaName () const
 Return full schema name in format GetName().MM.mm where Name is the schema name, MM is major version and mm is minor version. More...
 
ECObjectsStatus CopyClass (ECClassP &targetClass, ECClassCR sourceClass)
 Given a source class, will copy that class into this schema if it does not already exist. More...
 
ECObjectsStatus CopySchema (ECSchemaPtr &schemaOut) const
 Copies this schema. More...
 
IECCustomAttributeContainerGetCustomAttributeContainer ()
 Get the IECCustomAttributeContainer holding this schema's custom attributes. More...
 
IECCustomAttributeContainer const & GetCustomAttributeContainer () const
 Get the const IECCustomAttributeContainer holding this schema's custom attributes. More...
 
void FindAllSchemasInGraph (bvector< ECN::ECSchemaCP > &allSchemas, bool includeRootSchema=true) const
 Find all ECSchemas in the schema graph, avoiding duplicates and any cycles. More...
 
void FindAllSchemasInGraph (bvector< ECN::ECSchemaP > &allSchemas, bool includeRootSchema=true)
 Find all ECSchemas in the schema graph, avoiding duplicates and any cycles. More...
 
ECSchemaCP FindSchema (SchemaKeyCR schema, SchemaMatchType matchType) const
 Returns this if the name matches, otherwise searches referenced ECSchemas for one whose name matches schemaName. More...
 
ECSchemaP FindSchemaP (SchemaKeyCR schema, SchemaMatchType matchType)
 Returns this if the name matches, otherwise searches referenced ECSchemas for one whose name matches schemaName. More...
 
void SetImmutable ()
 Set the schema to be immutable. Immutable schema cannot be modified. More...
 
- Public Member Functions inherited from RefCounted< IRefCounted >
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 
UInt32 AddRef () const
 
UInt32 Release () const
 
 RefCounted ()
 
 RefCounted (RefCounted const &rhs)
 
RefCountedoperator= (RefCounted const &rhs)
 
UInt32 GetRefCount () const
 

Static Public Member Functions

static void SetErrorHandling (bool showMessages, bool doAssert)
 Used for debugging purposes. More...
 
static bool ShouldNotBeStored (SchemaKeyCR key)
 Returns true if and only if the full schema name (including version) represents a standard schema that should never be stored persistently in a repository (we expect it to be found elsewhere) More...
 
static uint32_t ComputeSchemaXmlStringCheckSum (WCharCP str, size_t len)
 Given a str containing SchemaXml, will compute the CheckSum. More...
 
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. More...
 
static WString FormatSchemaVersion (uint32_t &versionMajor, uint32_t &versionMinor)
 Generate a schema version string given the major and minor version values. More...
 
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. More...
 
static ECObjectsStatus ParseSchemaFullName (WString &schemaName, uint32_t &versionMajor, uint32_t &versionMinor, WStringCR fullName)
 Given a version string MM.NN, this will parse other major and minor versions. More...
 
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. More...
 
static bool IsSchemaReferenced (ECSchemaCR thisSchema, ECSchemaCR potentiallyReferencedSchema)
 Given two schemas, will check to see if the second schema is referenced by the first schema. More...
 
static SchemaReadStatus ReadFromXmlFile (ECSchemaPtr &schemaOut, WCharCP ecSchemaXmlFile, ECSchemaReadContextR schemaContext)
 Writes an ECSchema from an ECSchemaXML-formatted file. More...
 
static ECSchemaPtr LocateSchema (SchemaKeyR schema, ECSchemaReadContextR schemaContext)
 Locate a schema using the provided schema locators and paths. More...
 
static SchemaReadStatus ReadFromXmlString (ECSchemaPtr &schemaOut, Utf8CP ecSchemaXml, ECSchemaReadContextR schemaContext)
 Reads an ECSchema from a UTF-8 encoded ECSchemaXML-formatted string. More...
 
static SchemaReadStatus ReadFromXmlString (ECSchemaPtr &schemaOut, WCharCP ecSchemaXml, ECSchemaReadContextR schemaContext)
 Reads an ECSchema from an ECSchemaXML-formatted string. More...
 
static SchemaReadStatus ReadFromXmlString (ECSchemaPtr &schemaOut, WCharCP ecSchemaXml, ECSchemaCacheR schemaCache)
 Writes an ECSchema from an ECSchemaXML-formatted string. More...
 
static SchemaReadStatus ReadFromXmlStream (ECSchemaPtr &schemaOut, IStreamP ecSchemaXmlStream, ECSchemaReadContextR schemaContext)
 Writes an ECSchema from an ECSchemaXML-formatted string in an IStream. More...
 
static bool IsStandardSchema (WStringCR schemaName)
 Returns true if the schema is an ECStandard schema. More...
 

Additional Inherited Members

- Protected Member Functions inherited from RefCounted< IRefCounted >
virtual ~RefCounted ()
 
- Protected Member Functions inherited from IRefCounted
virtual ~IRefCounted ()
 
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 

Detailed Description

The in-memory representation of a schema as defined by ECSchemaXML.

Member Function Documentation

ECObjectsStatus AddReferencedSchema ( ECSchemaR  refSchema)

Adds an ECSchema as a referenced schema in this schema.

It is necessary to add any ECSchema as a referenced schema that will be used when adding a base class from a different schema, or custom attributes from a different schema.

Parameters
[in]refSchemaThe schema to add as a referenced schema
ECObjectsStatus AddReferencedSchema ( ECSchemaR  refSchema,
WStringCR  prefix 
)

Adds an ECSchema as a referenced schema in this schema.

It is necessary to add any ECSchema as a referenced schema that will be used when adding a base class from a different schema, or custom attributes from a different schema.

Parameters
[in]refSchemaThe schema to add as a referenced schema
[in]prefixThe prefix to use within the context of this schema for referencing the referenced schema
static uint32_t ComputeSchemaXmlStringCheckSum ( WCharCP  str,
size_t  len 
)
static

Given a str containing SchemaXml, will compute the CheckSum.

ECObjectsStatus CopyClass ( ECClassP &  targetClass,
ECClassCR  sourceClass 
)

Given a source class, will copy that class into this schema if it does not already exist.

Parameters
[out]targetClassIf successful, will contain a new ECClass object that is a copy of the sourceClass
[in]sourceClassThe class to copy
ECObjectsStatus CopySchema ( ECSchemaPtr schemaOut) const

Copies this schema.

Parameters
[out]schemaOutIf successful, will contain a copy of this schema
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.

Parameters
[out]ecClassIf successful, will contain a new ECClass object
[in]nameName of the class to create
Returns
A status code indicating whether or not the class was successfully created and added to the schema
ECObjectsStatus CreateRelationshipClass ( ECRelationshipClassP &  relationshipClass,
WStringCR  name 
)

If the class name is valid, will create an ECRelationshipClass object and add the new class to the schema.

Parameters
[out]relationshipClassIf successful, will contain a new ECRelationshipClass object
[in]nameName of the class to create
Returns
A status code indicating whether or not the class was successfully created and added to the schema
static ECObjectsStatus CreateSchema ( ECSchemaPtr schemaOut,
WStringCR  schemaName,
uint32_t  versionMajor,
uint32_t  versionMinor 
)
static

If the given schemaName is valid, this will create a new schema object.

Parameters
[out]schemaOutif successful, will contain a new schema object
[in]schemaNameName of the schema to be created.
[in]versionMajorThe major version number.
[in]versionMinorThe minor version number.
Returns
A status code indicating whether the call was succesfull or not
void DebugDump ( ) const

Prints out detailed information about this ECSchema, and then calls Dump() on each ECClass.

void FindAllSchemasInGraph ( bvector< ECN::ECSchemaCP > &  allSchemas,
bool  includeRootSchema = true 
) const

Find all ECSchemas in the schema graph, avoiding duplicates and any cycles.

Parameters
[out]allSchemasVector of schemas including rootSchema.
[in]includeRootSchemaIf true then root schema is added to the vector of allSchemas. Defaults to true.
void FindAllSchemasInGraph ( bvector< ECN::ECSchemaP > &  allSchemas,
bool  includeRootSchema = true 
)

Find all ECSchemas in the schema graph, avoiding duplicates and any cycles.

Parameters
[out]allSchemasVector of schemas including rootSchema.
[in]includeRootSchemaIf true then root schema is added to the vector of allSchemas. Defaults to true.
ECSchemaCP FindSchema ( SchemaKeyCR  schema,
SchemaMatchType  matchType 
) const

Returns this if the name matches, otherwise searches referenced ECSchemas for one whose name matches schemaName.

ECSchemaP FindSchemaP ( SchemaKeyCR  schema,
SchemaMatchType  matchType 
)

Returns this if the name matches, otherwise searches referenced ECSchemas for one whose name matches schemaName.

static WString FormatSchemaVersion ( uint32_t versionMajor,
uint32_t versionMinor 
)
static

Generate a schema version string given the major and minor version values.

Parameters
[in]versionMajorThe major version number
[in]versionMinorThe minor version number
Returns
The version string
uint32_t GetClassCount ( ) const

Gets the number of classes in the schema.

ECClassCP GetClassCP ( WCharCP  name) const

Get a class by name within the context of this schema.

Parameters
[in]nameThe name of the class to lookup. This must be an unqualified (short) class name.
Returns
A const pointer to an ECN::ECClass if the named class exists in within the current schema; otherwise, NULL
ECClassContainerCR GetClasses ( ) const

Returns an iterable container of ECClasses sorted by name. For unsorted called overload.

ECClassP GetClassP ( WCharCP  name)

Get a class by name within the context of this schema.

Parameters
[in]nameThe name of the class to lookup. This must be an unqualified (short) class name.
Returns
A pointer to an ECN::ECClass if the named class exists in within the current schema; otherwise, NULL
IECCustomAttributeContainer& GetCustomAttributeContainer ( )

Get the IECCustomAttributeContainer holding this schema's custom attributes.

IECCustomAttributeContainer const& GetCustomAttributeContainer ( ) const

Get the const IECCustomAttributeContainer holding this schema's custom attributes.

WStringCR GetDescription ( ) const

Gets the description for this ECSchema. Returns the localized description if one exists.

WStringCR GetDisplayLabel ( ) const

Gets the DisplayLabel for this ECSchema.

If no DisplayLabel has been set explicitly, returns the name of the schema Gets the DisplayLabel for this ECSchema. If no DisplayLabel has been set explicitly, returns the name of the schema.

WString GetFullSchemaName ( ) const

Return full schema name in format GetName().MM.mm where Name is the schema name, MM is major version and mm is minor version.

ECSchemaId GetId ( ) const

Return unique id (May return 0 until it has been explicitly set by ECDb or a similar system)

WStringCR GetInvariantDescription ( ) const

Gets the invariant description for this ECSchema.

WStringCR GetInvariantDisplayLabel ( ) const

Gets the invariant display label for this ECSchema.

bool GetIsDisplayLabelDefined ( ) const

Returns true if the display label has been set explicitly for this schema or not.

WStringCR GetName ( ) const

Returns the name of this ECSchema.

WStringCR GetNamespacePrefix ( ) const

Gets the namespace prefix for this ECSchema.

ECSchemaReferenceListCR GetReferencedSchemas ( ) const

Gets the other schemas that are used by classes within this schema.

Referenced schemas are the schemas that contain definitions of base classes, embedded structures, and custom attributes of classes within this schema.

ECSchemaCP GetSchemaByNamespacePrefixP ( WStringCR  namespacePrefix) const

Get a schema by namespace prefix within the context of this schema and its referenced schemas.

Parameters
[in]namespacePrefixThe prefix of the schema to lookup in the context of this schema and it's references. Passing an empty namespacePrefix will return a pointer to the current schema.
Returns
A non-refcounted pointer to an ECN::ECSchema if it can be successfully resolved from the specified namespacePrefix; otherwise, NULL
SchemaKeyCR GetSchemaKey ( ) const

Returns a SchemaKey fully describing this schema.

SupplementalSchemaInfoPtr const GetSupplementalInfo ( ) const

Gets the SupplementalSchemaInfo for this ECSchema.

uint32_t GetVersionMajor ( ) const

Gets the major version of this schema.

uint32_t GetVersionMinor ( ) const

Gets the minor version of this schema.

bool IsSamePrimarySchema ( ECSchemaR  primarySchema) const

Returns true if the passed in schema is the same base schema as the current schema.

Remarks
FullName, NamespacePrefix, and ClassCount are checked
Returns
True if the schemas are the same
static bool IsSchemaReferenced ( ECSchemaCR  thisSchema,
ECSchemaCR  potentiallyReferencedSchema 
)
static

Given two schemas, will check to see if the second schema is referenced by the first schema.

Parameters
[in]thisSchemaThe base schema to check the references of
[in]potentiallyReferencedSchemaThe schema to search for
Returns
True if thatSchema is referenced by thisSchema, false otherwise
bool IsStandardSchema ( ) const

Returns true if the schema is an ECStandard schema.

Returns
True if a standard schema, false otherwise
static bool IsStandardSchema ( WStringCR  schemaName)
static

Returns true if the schema is an ECStandard schema.

Returns
True if a standard schema, false otherwise
Parameters
[in]schemaNameName of the schema to test. This is just the schema name, no version info
bool IsSupplementalSchema ( ) const

Indicates whether this schema is a supplemental schema or not.

Returns
True if this schema is a supplemental schema
bool IsSupplemented ( ) const

Returns true if the schema is a supplemented schema.

Returns
True if the schema is a supplemented schema
static ECSchemaPtr LocateSchema ( SchemaKeyR  schema,
ECSchemaReadContextR  schemaContext 
)
static

Locate a schema using the provided schema locators and paths.

If not found in those by either of those parameters standard schema pathes relative to the executing dll will be searched.

Parameters
[in]schemaKey describing the schema to be located
[in]schemaContextRequired to create schemas
static ECObjectsStatus ParseSchemaFullName ( WString schemaName,
uint32_t versionMajor,
uint32_t versionMinor,
WCharCP  fullName 
)
static

Given a version string MM.NN, this will parse other major and minor versions.

Parameters
[out]schemaNameThe schema name without version number qualifiers
[out]versionMajorThe major version number
[out]versionMinorThe minor version number
[in]fullNameA string containing the schema name and major and minor versions (GetName().MM.NN)
Returns
A status code indicating whether the string was successfully parsed
static ECObjectsStatus ParseSchemaFullName ( WString schemaName,
uint32_t versionMajor,
uint32_t versionMinor,
WStringCR  fullName 
)
static

Given a version string MM.NN, this will parse other major and minor versions.

Parameters
[out]schemaNameThe schema name without version number qualifiers
[out]versionMajorThe major version number
[out]versionMinorThe minor version number
[in]fullNameA string containing the schema name and major and minor versions (GetName().MM.NN)
Returns
A status code indicating whether the string was successfully parsed
static ECObjectsStatus ParseVersionString ( uint32_t versionMajor,
uint32_t versionMinor,
WCharCP  versionString 
)
static

Given a version string MM.NN, this will parse other major and minor versions.

Parameters
[out]versionMajorThe major version number
[out]versionMinorThe minor version number
[in]versionStringA string containing the major and minor versions (MM.NN)
Returns
A status code indicating whether the string was successfully parsed
static SchemaReadStatus ReadFromXmlFile ( ECSchemaPtr schemaOut,
WCharCP  ecSchemaXmlFile,
ECSchemaReadContextR  schemaContext 
)
static

Writes an ECSchema from an ECSchemaXML-formatted file.

// The IECSchemaOwner determines the lifespan of any ECSchema objects that are created using it.
// ECSchemaCache also caches ECSchemas and implements IStandaloneEnablerLocater for use by ECSchemaReadContext
// The schemaContext supplies an IECSchemaOwner to control the lifetime of read ECSchemas and a
// IStandaloneEnablerLocater to locate enablers for ECCustomAttributes in the ECSchema
ECSchemaReadContextPtr schemaContext = ECSchemaReadContext::CreateContext(*schemaOwner);
ECSchemaP schema;
SchemaReadStatus status = ECSchema::ReadFromXmlFile (schema, ecSchemaFilename, *schemaContext);
return ERROR;
Parameters
[out]schemaOutThe read schema
[in]ecSchemaXmlFileThe absolute path of the file to write.
[in]schemaContextRequired to create schemas
Returns
A status code indicating whether the schema was successfully read. If SUCCESS is returned then schemaOut will contain the read schema. Otherwise schemaOut will be unmodified.
static SchemaReadStatus ReadFromXmlStream ( ECSchemaPtr schemaOut,
IStreamP  ecSchemaXmlStream,
ECSchemaReadContextR  schemaContext 
)
static

Writes an ECSchema from an ECSchemaXML-formatted string in an IStream.

Parameters
[out]schemaOutThe read schema
[in]ecSchemaXmlStreamThe IStream containing ECSchemaXML to write
[in]schemaContextRequired to create schemas
Returns
A status code indicating whether the schema was successfully read. If SUCCESS is returned then schemaOut will contain the read schema. Otherwise schemaOut will be unmodified.
static SchemaReadStatus ReadFromXmlString ( ECSchemaPtr schemaOut,
Utf8CP  ecSchemaXml,
ECSchemaReadContextR  schemaContext 
)
static

Reads an ECSchema from a UTF-8 encoded ECSchemaXML-formatted string.

// The IECSchemaOwner determines the lifespan of any ECSchema objects that are created using it.
// The schemaContext supplies an IECSchemaOwner to control the lifetime of read ECSchemas and a
ECSchemaP schema;
SchemaReadStatus status = ECSchema::ReadFromXmlString (schema, ecSchemaAsString, *schemaContext);
return ERROR;
Parameters
[out]schemaOutThe read schema
[in]ecSchemaXmlThe UTF-8 encoded string containing ECSchemaXML to write
[in]schemaContextRequired to create schemas
Returns
A status code indicating whether the schema was successfully read. If SUCCESS is returned then schemaOut will contain the read schema. Otherwise schemaOut will be unmodified.
static SchemaReadStatus ReadFromXmlString ( ECSchemaPtr schemaOut,
WCharCP  ecSchemaXml,
ECSchemaReadContextR  schemaContext 
)
static

Reads an ECSchema from an ECSchemaXML-formatted string.

// The IECSchemaOwner determines the lifespan of any ECSchema objects that are created using it.
// The schemaContext supplies an IECSchemaOwner to control the lifetime of read ECSchemas and a
ECSchemaP schema;
SchemaReadStatus status = ECSchema::ReadFromXmlString (schema, ecSchemaAsString, *schemaContext);
return ERROR;
Parameters
[out]schemaOutThe read schema
[in]ecSchemaXmlThe string containing ECSchemaXML to write
[in]schemaContextRequired to create schemas
Returns
A status code indicating whether the schema was successfully read. If SUCCESS is returned then schemaOut will contain the read schema. Otherwise schemaOut will be unmodified.
static SchemaReadStatus ReadFromXmlString ( ECSchemaPtr schemaOut,
WCharCP  ecSchemaXml,
ECSchemaCacheR  schemaCache 
)
static

Writes an ECSchema from an ECSchemaXML-formatted string.

ECSchemaPtr schema;
SchemaReadStatus status = ECSchema::ReadFromXmlString (schema, ecSchemaAsString, *schemaOwner);
return ERROR;
Parameters
[out]schemaOutThe read schema
[in]ecSchemaXmlThe string containing ECSchemaXML to write
[in]schemaCacheWill own the read ECSchema and referenced ECSchemas.
Returns
A status code indicating whether the schema was successfully read. If SUCCESS is returned then schemaOut will contain the read schema. Otherwise schemaOut will be unmodified.
ECObjectsStatus RemoveReferencedSchema ( ECSchemaR  refSchema)

Removes an ECSchema from the list of referenced schemas.

Parameters
[in]refSchemaThe schema that should be removed from the list of referenced schemas
ECObjectsStatus ResolveNamespacePrefix ( ECSchemaCR  schema,
WStringR  namespacePrefix 
) const

Resolve a namespace prefix for the specified schema within the context of this schema and its references.

Parameters
[in]schemaThe schema to lookup a namespace prefix in the context of this schema and its references.
[out]namespacePrefixThe namespace prefix if schema is a referenced schema; empty string if the sechema is the current schema;
Returns
Success if the schema is either the current schema or a referenced schema; ECOBJECTS_STATUS_SchemaNotFound if the schema is not found in the list of referenced schemas
ECObjectsStatus SetDescription ( WStringCR  value)

Sets the description for this ECSchema.

ECObjectsStatus SetDisplayLabel ( WStringCR  value)

Sets the display label for this ECSchema.

static void SetErrorHandling ( bool  showMessages,
bool  doAssert 
)
static

Used for debugging purposes.

Parameters
[in]showMessagesControls whether messages are displayed during BeXml operations. Defaults to true.
[in]doAssertControls whether asserts should be tested or not. Defaults to true.
void SetImmutable ( )

Set the schema to be immutable. Immutable schema cannot be modified.

ECObjectsStatus SetName ( WStringCR  value)

Sets the name of this schema.

Parameters
[in]valueThe name of the ECSchema
Returns
Success if the name passes validation and is set, ECOBJECTS_STATUS_InvalidName otherwise
ECObjectsStatus SetNamespacePrefix ( WStringCR  value)

Sets the namespace prefix for this ECSchema.

ECObjectsStatus SetVersionMajor ( uint32_t  value)

Sets the major version of this schema.

ECObjectsStatus SetVersionMinor ( uint32_t  value)

Sets the minor version of this schema.

bool ShouldNotBeStored ( ) const

Returns true if and only if the full schema name (including version) represents a standard schema that should never be stored persistently in a repository (we expect it to be found elsewhere)

Returns
True if this version of the schema is one that should never be imported into a repository
static bool ShouldNotBeStored ( SchemaKeyCR  key)
static

Returns true if and only if the full schema name (including version) represents a standard schema that should never be stored persistently in a repository (we expect it to be found elsewhere)

Parameters
[in]keySchemaKey to test
Returns
True if this version of the schema is one that should never be imported into a repository
SchemaWriteStatus WriteToXmlFile ( WCharCP  ecSchemaXmlFile,
bool  utf16 = false 
)

Serializes an ECXML schema to a file.

Parameters
[in]ecSchemaXmlFileThe absolute path of the file to serialize the schema to
[in]utf16'false' (the default) to use utf-8 encoding
Returns
A Status code indicating whether the schema was successfully serialized. If SUCCESS is returned, then the file pointed
SchemaWriteStatus WriteToXmlStream ( IStreamP  ecSchemaXmlStream,
bool  utf16 = false 
)

Writes an ECXML schema to an IStream.

Parameters
[in]ecSchemaXmlStreamThe IStream to write the serialized XML to
[in]utf16'false' (the default) to use utf-8 encoding
Returns
A Status code indicating whether the schema was successfully serialized. If SUCCESS is returned, then the IStream will contain the serialized schema.
SchemaWriteStatus WriteToXmlString ( WStringR  ecSchemaXml) const

Serializes an ECXML schema to a string.

Parameters
[out]ecSchemaXmlThe string containing the Xml of the serialized schema
Returns
A Status code indicating whether the schema was successfully serialized. If SUCCESS is returned, then ecSchemaXml
SchemaWriteStatus WriteToXmlString ( Utf8StringR  ecSchemaXml) const

Serializes an ECXML schema to a string.

Parameters
[out]ecSchemaXmlThe string containing the Xml of the serialized schema
Returns
A Status code indicating whether the schema was successfully serialized. If SUCCESS is returned, then ecSchemaXml

The documentation for this struct was generated from the following file:

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.