Public Types | Public Member Functions | Static Public Member Functions | List of all members
DgnTextSnippet Struct Reference

!DgnTextSnippet is a named serialized textblock which is stored in the dictionary model. More...

#include <DgnTextSnippet.h>

Inheritance diagram for DgnTextSnippet:
RefCountedBase RefCounted< IRefCounted > IRefCounted

Public Types

enum  DgnTextSnippetProperty {
  SnippetName = 1, SnippetText = 2, FromActiveFile = 3, SnippetCategory = 4,
  SnippetDisplayName = 5, PROPERTY_COUNT
}
 
typedef
DgnTextSnippetPropertyMaskPtr 
PropertyMaskPtr
 

Public Member Functions

DGNPLATFORM_EXPORT DgnFileR GetFile () const
 Get the file associated with this file. More...
 
DGNPLATFORM_EXPORT WString GetName () const
 Get the name of this snippet. More...
 
DGNPLATFORM_EXPORT ElementId GetID () const
 Gets the snippet id. More...
 
DGNPLATFORM_EXPORT BentleyStatus SetName (WCharCP name)
 Set the name of this snippet. More...
 
DGNPLATFORM_EXPORT WString GetDisplayName () const
 Get the display name of this snippet. More...
 
DGNPLATFORM_EXPORT BentleyStatus SetDisplayName (WCharCP name)
 Set the display name of this snippet. More...
 
DGNPLATFORM_EXPORT TextBlockCP GetSnippetText () const
 Get the text associated with this snippet. More...
 
DGNPLATFORM_EXPORT BentleyStatus SetSnippetText (TextBlockCR text)
 Set the snippet text content. More...
 
DGNPLATFORM_EXPORT
DgnTextSnippetCategoryCP 
GetCategory () const
 Get the category of this snippet. More...
 
DGNPLATFORM_EXPORT BentleyStatus SetCategory (DgnTextSnippetCategoryCP category)
 Set the category of this snippet. More...
 
DGNPLATFORM_EXPORT BentleyStatus Add (DgnFileP file=NULL)
 Creates a snippet in the given file. More...
 
DGNPLATFORM_EXPORT BentleyStatus Replace (WCharCP oldName=NULL, DgnFileP file=NULL)
 
DGNPLATFORM_EXPORT void CopyValues (DgnTextSnippetCR snippet)
 Copies the values into the current snippet from another snippet. More...
 
DGNPLATFORM_EXPORT
DgnTextSnippetPropertyMaskPtr 
Compare (DgnTextSnippetCR snippet) const
 Compares the snippet with the provided one. More...
 
DGNPLATFORM_EXPORT bool IsPersisted () const
 
- 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 DGNPLATFORM_EXPORT
DgnTextSnippetPtr 
Create (WCharCP name, DgnFileR file)
 Create an in memory representation of any empty snippet with respect to the given file. More...
 
static DGNPLATFORM_EXPORT
BentleyStatus 
Delete (WCharCP name, DgnFileR file)
 Deletes a DgnTextSnippet from the snippet file. More...
 
static DGNPLATFORM_EXPORT
DgnTextSnippetPtr 
GetByName (WCharCP name, DgnFileR file)
 Looks up the snippet from the given file. More...
 
static DGNPLATFORM_EXPORT
DgnTextSnippetPtr 
GetByID (ElementId id, DgnFileR file)
 Looks up the snippet from the given file. More...
 
static DGNPLATFORM_EXPORT void UpgradeSchemaAndInstance (DgnFileP file)
 

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

!DgnTextSnippet is a named serialized textblock which is stored in the dictionary model.

!The DgnTextSnippet class provides API to Get them by their name or ID and basic create, delete, update !operations. !

Remarks
Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib !

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
SnippetName 
SnippetText 
FromActiveFile 
SnippetCategory 
SnippetDisplayName 
PROPERTY_COUNT 

Member Function Documentation

Creates a snippet in the given file.

Parameters
fileIN file pointer for the target snippet.
Returns
status. Note: it returns ERROR if a snippet is already present

Compares the snippet with the provided one.

Parameters
snippetIN snippet to be comapred against.
Returns
DgnTextSnippetPropertyMaskPtr Pointer filled with differences.
DGNPLATFORM_EXPORT void CopyValues ( DgnTextSnippetCR  snippet)

Copies the values into the current snippet from another snippet.

static DGNPLATFORM_EXPORT DgnTextSnippetPtr Create ( WCharCP  name,
DgnFileR  file 
)
static

Create an in memory representation of any empty snippet with respect to the given file.

Parameters
nameIN name of the new snippet. Can be empty.
fileIN The file where the snippet will be stored.
Returns
A snippet pointer for the template snippet. NULL if it is unsuccessful.
static DGNPLATFORM_EXPORT BentleyStatus Delete ( WCharCP  name,
DgnFileR  file 
)
static

Deletes a DgnTextSnippet from the snippet file.

Parameters
nameIN name to lookup for.
fileIN file in which to search.
static DGNPLATFORM_EXPORT DgnTextSnippetPtr GetByID ( ElementId  id,
DgnFileR  file 
)
static

Looks up the snippet from the given file.

Parameters
idIN snippet ID to be fetched.
filefile in which to search.
Returns
snippet pointer if found else null.
static DGNPLATFORM_EXPORT DgnTextSnippetPtr GetByName ( WCharCP  name,
DgnFileR  file 
)
static

Looks up the snippet from the given file.

Parameters
nameIN name to lookup for.
fileIN file in which to search.
Returns
snippet pointer if found else null.

Get the category of this snippet.

DGNPLATFORM_EXPORT WString GetDisplayName ( ) const

Get the display name of this snippet.

DGNPLATFORM_EXPORT DgnFileR GetFile ( ) const

Get the file associated with this file.

DGNPLATFORM_EXPORT ElementId GetID ( ) const

Gets the snippet id.

DGNPLATFORM_EXPORT WString GetName ( ) const

Get the name of this snippet.

DGNPLATFORM_EXPORT TextBlockCP GetSnippetText ( ) const

Get the text associated with this snippet.

DGNPLATFORM_EXPORT bool IsPersisted ( ) const
DGNPLATFORM_EXPORT BentleyStatus Replace ( WCharCP  oldName = NULL,
DgnFileP  file = NULL 
)

Set the category of this snippet.

DGNPLATFORM_EXPORT BentleyStatus SetDisplayName ( WCharCP  name)

Set the display name of this snippet.

Set the name of this snippet.

DGNPLATFORM_EXPORT BentleyStatus SetSnippetText ( TextBlockCR  text)

Set the snippet text content.

static DGNPLATFORM_EXPORT void UpgradeSchemaAndInstance ( DgnFileP  file)
static

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

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