3#include <Foundation/Basics.h>
4#include <Foundation/Containers/DynamicArray.h>
5#include <Foundation/Containers/HybridArray.h>
6#include <Foundation/IO/Stream.h>
11enum class plOpenDdlPrimitiveType
52 void SetCacheSize(plUInt32 uiSizeInKB);
55 void SetInputStream(
plStreamReader& stream, plUInt32 uiFirstLineOffset = 0);
60 bool ContinueParsing();
66 void SkipRestOfObject();
105 virtual void OnPrimitiveInt8(plUInt32 count,
const plInt8* pData,
bool bThisIsAll) = 0;
164 bool ReadCharacter();
165 bool ReadCharacterSkipComments();
166 void SkipWhitespace();
168 void ReadIdentifier(plUInt8* szString, plUInt32& count);
171 plUInt64 ReadDecimalLiteral();
172 void PurgeCachedPrimitives(
bool bThisIsAll);
173 bool ContinuePrimitiveList();
174 void ContinueString();
178 void ContinueFloat();
180 void ReadDecimalFloat();
181 void ReadHexString();
187 static constexpr plUInt32 s_uiMaxIdentifierLength = 64;
190 plUInt8 m_uiNextByte;
191 plUInt32 m_uiCurLine;
192 plUInt32 m_uiCurColumn;
193 bool m_bSkippingMode;
194 bool m_bHadFatalParsingError;
195 plUInt8 m_szIdentifierType[s_uiMaxIdentifierLength];
196 plUInt8 m_szIdentifierName[s_uiMaxIdentifierLength];
198 plUInt32 m_uiTempStringLength;
200 plUInt32 m_uiNumCachedPrimitives;
202 plInt8* m_pInt8Cache;
203 plInt16* m_pInt16Cache;
204 plInt32* m_pInt32Cache;
205 plInt64* m_pInt64Cache;
206 plUInt8* m_pUInt8Cache;
207 plUInt16* m_pUInt16Cache;
208 plUInt32* m_pUInt32Cache;
209 plUInt64* m_pUInt64Cache;
210 float* m_pFloatCache;
211 double* m_pDoubleCache;
Definition DynamicArray.h:81
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Base class for all logging classes.
Definition Log.h:77
A low level parser for the OpenDDL format. It can incrementally parse the structure,...
Definition OpenDdlParser.h:35
virtual void OnPrimitiveUInt16(plUInt32 count, const plUInt16 *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnPrimitiveDouble(plUInt32 count, const double *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnEndPrimitiveList()=0
Called when the end of a primitive object is encountered.
void SetLogInterface(plLogInterface *pLog)
Sets an plLogInterface through which errors and warnings are reported.
Definition OpenDdlParser.h:45
virtual void OnPrimitiveInt32(plUInt32 count, const plInt32 *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnParsingError(plStringView sMessage, bool bFatal, plUInt32 uiLine, plUInt32 uiColumn)
Called when something unexpected is encountered in the document.
Definition OpenDdlParser.h:83
virtual void OnBeginPrimitiveList(plOpenDdlPrimitiveType type, plStringView sName, bool bGlobalName)=0
Called when a new primitive object is encountered.
virtual void OnPrimitiveUInt32(plUInt32 count, const plUInt32 *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnPrimitiveInt16(plUInt32 count, const plInt16 *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnPrimitiveBool(plUInt32 count, const bool *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnPrimitiveInt64(plUInt32 count, const plInt64 *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnPrimitiveFloat(plUInt32 count, const float *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnPrimitiveUInt8(plUInt32 count, const plUInt8 *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnPrimitiveUInt64(plUInt32 count, const plUInt64 *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnEndObject()=0
Called when the end of an object is encountered.
virtual void OnBeginObject(plStringView sType, plStringView sName, bool bGlobalName)=0
Called when a new object is encountered.
virtual void OnPrimitiveString(plUInt32 count, const plStringView *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
virtual void OnPrimitiveInt8(plUInt32 count, const plInt8 *pData, bool bThisIsAll)=0
Called when data for a primitive type is available. More than one value may be reported at a time.
bool HadFatalParsingError() const
Whether an error occurred during parsing that resulted in cancellation of further parsing.
Definition OpenDdlParser.h:41
Interface for binary in (read) streams.
Definition Stream.h:22
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54