CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | Static Public Member Functions | List of all members
CartoType::CFrameworkEngine Class Reference

#include <cartotype_framework.h>

Public Member Functions

 CFrameworkEngine (const std::vector< TTypefaceData > &aTypefaceDataArray, int32_t aFileBufferSizeInBytes, int32_t aMaxFileBufferCount, int32_t aTextIndexLevels)
 
TResult Configure (const CString &aFilename)
 
TResult LoadFont (const CString &aFontFileName)
 
TResult LoadFont (const uint8_t *aData, size_t aLength, bool aCopyData)
 
std::unique_ptr< CFrameworkEngineCopy (TResult &aError)
 
std::shared_ptr< CEngine > Engine () const
 

Static Public Member Functions

static std::unique_ptr< CFrameworkEngineNew (TResult &aError, const CString &aFontFileName, int32_t aFileBufferSizeInBytes=0, int32_t aMaxFileBufferCount=0, int32_t aTextIndexLevels=0)
 
static std::unique_ptr< CFrameworkEngineNew (TResult &aError, const std::vector< TTypefaceData > &aTypefaceDataArray, int32_t aFileBufferSizeInBytes=0, int32_t aMaxFileBufferCount=0, int32_t aTextIndexLevels=0)
 

Detailed Description

CFrameworkEngine holds a CTM1 data accessor and a standard font. Together with a CFrameworkMapDataSet object it makes up the 'model' part of the model-view-controller pattern.

Constructor & Destructor Documentation

◆ CFrameworkEngine()

CartoType::CFrameworkEngine::CFrameworkEngine ( const std::vector< TTypefaceData > &  aTypefaceDataArray,
int32_t  aFileBufferSizeInBytes,
int32_t  aMaxFileBufferCount,
int32_t  aTextIndexLevels 
)

Creates a CFrameworkEngine object, loading the fonts in aTypefaceDataArray. Throws an exception on error.

aFileBufferSizeInBytes and aMaxFileBufferCount can be used to control file buffering when reading map data files. Zero values cause defaults to be used.

aTextIndexLevels sets the number of levels of the text index to be loaded into RAM. A value of zero causes the default number of levels (1) to be loaded. Low levels save run-time RAM; -1 prevents the text index from being loaded.

Member Function Documentation

◆ Configure()

TResult CartoType::CFrameworkEngine::Configure ( const CString aFilename)

Configure the CartoType engine by reading an XML configuration file.

◆ Copy()

std::unique_ptr< CFrameworkEngine > CartoType::CFrameworkEngine::Copy ( TResult aError)

Create a copy of a CFrameworkEngine object, loading the same fonts and reading the same configuration file.

◆ Engine()

std::shared_ptr< CEngine > CartoType::CFrameworkEngine::Engine ( ) const
inline

Returns the CEngine object used by this CFrameworkEngine. For internal use only.

◆ LoadFont() [1/2]

TResult CartoType::CFrameworkEngine::LoadFont ( const CString aFontFileName)

Loads a font in addition to any fonts already loaded.

◆ LoadFont() [2/2]

TResult CartoType::CFrameworkEngine::LoadFont ( const uint8_t *  aData,
size_t  aLength,
bool  aCopyData 
)

Loads a font from data in memory. If aCopyData is true, makes a copy of the data and uses the copy, otherwise uses the supplied pointer aData, which must point to data that survives at least as long as the CFrameworkEngine object exists, or until the font is unloaded.

◆ New() [1/2]

std::unique_ptr< CFrameworkEngine > CartoType::CFrameworkEngine::New ( TResult aError,
const CString aFontFileName,
int32_t  aFileBufferSizeInBytes = 0,
int32_t  aMaxFileBufferCount = 0,
int32_t  aTextIndexLevels = 0 
)
static

Creates a CFrameworkEngine object, loading the font aFontFileName. If any error occurs it is returned in aError and the function returns nullptr.

aFileBufferSizeInBytes and aMaxFileBufferCount can be used to control file buffering when reading map data files. Zero values cause defaults to be used.

aTextIndexLevels sets the number of levels of the text index to be loaded into RAM. A value of zero causes the default number of levels (1) to be loaded. Low levels save run-time RAM; -1 prevents the text index from being loaded.

◆ New() [2/2]

std::unique_ptr< CFrameworkEngine > CartoType::CFrameworkEngine::New ( TResult aError,
const std::vector< TTypefaceData > &  aTypefaceDataArray,
int32_t  aFileBufferSizeInBytes = 0,
int32_t  aMaxFileBufferCount = 0,
int32_t  aTextIndexLevels = 0 
)
static

Creates a CFrameworkEngine object, loading the fonts in aTypefaceDataArray. If any error occurs it is returned in aError and the function returns nullptr.

aFileBufferSizeInBytes and aMaxFileBufferCount can be used to control file buffering when reading map data files. Zero values cause defaults to be used.

aTextIndexLevels sets the number of levels of the text index to be loaded into RAM. A value of zero causes the default number of levels (1) to be loaded. Low levels save run-time RAM; -1 prevents the text index from being loaded.


The documentation for this class was generated from the following files: