Pointwise Plugin SDK
|
#include <map>
#include <sstream>
#include <string>
#include <utility>
#include <string.h>
#include "apiPWP.h"
#include "apiPWPUtils.h"
Go to the source code of this file.
Classes | |
class | NamedStrings |
Macros | |
#define | ENDIAN_MAXSIZE 32 |
#define | STAT_BASE ((PWP_UINT32)(0x9ABCDEF0)) |
#define | STAT_CLOSED ((PWP_UINT32)(STAT_BASE | 0x0)) |
#define | STAT_MASK ((PWP_UINT32)(0xFFFFFFF0)) |
#define | STAT_OPEN ((PWP_UINT32)(STAT_BASE | 0x1)) |
#define | UDATA_INREC(pUD) (UDATA_ISOPEN(pUD) && (pUD)->inRec) |
#define | UDATA_ISCLOSED(pUD) ((pUD) && (STAT_CLOSED == (pUD)->status)) |
#define | UDATA_ISINIT(pUD) (STAT_BASE == (STAT_MASK & (pUD)->status)) |
#define | UDATA_ISOPEN(pUD) ((pUD) && (STAT_OPEN == (pUD)->status) && (pUD)->fp && !(pUD)->hadError) |
Typedefs | |
typedef std::string | PwuString |
Functions | |
const void * | PwuApplyEndianness (PWP_ENDIANNESS endianness, const void *buf, size_t size) |
Apply specified byte order to buf containing size bytes. More... | |
PWP_BOOL | PwuAssignValue (const char group[], const char name[], const char value[], bool createIfNotExists) |
Assign or create a value. More... | |
PWP_BOOL | PwuAssignValueEnum (const char group[], const char name[], const char value[], bool createIfNotExists) |
PWP_BOOL | PwuAssignValueInt (const char group[], const char name[], PWP_INT value, bool createIfNotExists) |
PWP_BOOL | PwuAssignValueReal (const char group[], const char name[], PWP_REAL value, bool createIfNotExists) |
PWP_BOOL | PwuAssignValueUInt (const char group[], const char name[], PWP_UINT value, bool createIfNotExists) |
static PWU_RTITEM * | PwuFindAPI (const char api[], PWP_UINT32 cnt) |
PWP_MESSAGECB | PwuFindApiMsgCB (const char api[]) |
Search pwpRtItem[] for an API's messageCB. More... | |
PWU_RTITEM * | PwuFindPublishedAPI (const char api[]) |
Find a published api in pwpRtItem[]. More... | |
PWU_RTITEM * | PwuFindTotalAPI (const char api[]) |
Find any api in pwpRtItem[]. More... | |
PWP_ENDIANNESS | PwuGetOsEndianness (void) |
Query the OS's native endianness. More... | |
PWP_BOOL | PwuGetValue (const char group[], const char name[], PWP_HVALUE hVal) |
Implementation of the PwpGetValue() API function. More... | |
PwuString | PwuJoin (const PwuString &j1, const PwuString &j2, char sepChar='.') |
PwuString | PwuJoin (const PwuString &j1, const PwuString &j2, const PwuString &j3, char sepChar='.') |
PwuString | PwuJoin (const PwuString &j1, const PwuString &j2, const PwuString &j3, const PwuString &j4, char sepChar='.') |
PWP_BOOL | PwuProgressBegin (const char api[], PWP_UINT32 totalSteps) |
Send a progress begin message (PWP_MSGID_PROGBEGIN) to the framework. More... | |
void | PwuProgressEnd (const char api[], PWP_BOOL ok) |
Send a progress end message (PWP_MSGID_PROGEND) to the framework. More... | |
PWP_BOOL | PwuProgressNextStep (const char api[]) |
Send a progress "next step" message (PWP_MSGID_PROGSTATUS, value = -1) to the framework. More... | |
PWP_BOOL | PwuProgressQuit (const char api[]) |
Send a progress query-quit message (PWP_MSGID_PROGQUIT) to the framework. More... | |
PWP_BOOL | PwuProgressStatus (const char api[], PWP_UINT32 complete, PWP_UINT32 total) |
Send a progress status message (PWP_MSGID_PROGSTATUS, value >= 0) to the framework. More... | |
PWP_BOOL | PwuPublishValueDefinition (const char group[], const char name[], PWP_ENUM_VALTYPE type, const char value[], const char access[], const char desc[], const char range[]) |
Create a value. More... | |
void | PwuSendDebugMsg (const char api[], const char txt[], PWP_UINT32 code) |
Send a debug text message (PWP_MSGID_DEBUG) to the framework. More... | |
void | PwuSendErrorMsg (const char api[], const char txt[], PWP_UINT32 code) |
Send an error text message (PWP_MSGID_ERROR) to the framework. More... | |
void | PwuSendInfoMsg (const char api[], const char txt[], PWP_UINT32 code) |
Send an info text message (PWP_MSGID_INFO) to the framework. More... | |
PWP_UINT32 | PwuSendMsg (const char api[], PWP_ENUM_MSGID id, void *pMsg) |
Send a message from an api. More... | |
static PWP_UINT32 | PwuSendProgressMsg (const char api[], PWP_ENUM_MSGID id, PWP_UINT32 value) |
static void | PwuSendTextMsg (const char api[], PWP_ENUM_MSGID id, const char txt[], PWP_UINT32 code) |
void | PwuSendWarningMsg (const char api[], const char txt[], PWP_UINT32 code) |
Send a warning text message (PWP_MSGID_WARNING) to the framework. More... | |
PWP_BOOL | PwuUnfFileBegin (FILE *fp, PWU_UNFDATA *pUData) |
Prepares a PWU_UNFDATA block for a new unformatted file I/O session. More... | |
PWP_BOOL | PwuUnfFileEnd (PWU_UNFDATA *pUData) |
Finalize an unformatted file I/O session. More... | |
PWP_ENDIANNESS | PwuUnfFileGetEndianness (PWU_UNFDATA *pUData) |
Get the output endianness setting for this PWU_UNFDATA block. More... | |
PWP_ENDIANNESS | PwuUnfFileSetEndianness (PWU_UNFDATA *pUData, PWP_ENDIANNESS endianness) |
Set the output endianness. More... | |
PWP_BOOL | PwuUnfHadError (PWU_UNFDATA *pUData) |
Check if an unformatted file I/O session has detected any errors. More... | |
PWP_BOOL | PwuUnfRecBegin (PWU_UNFDATA *pUData) |
Prepares a PWU_UNFDATA block for writing a new unformatted data record. More... | |
PWP_BOOL | PwuUnfRecBeginFixed (PWU_UNFDATA *pUData, PWP_UINT32 bytes, PWP_UINT32 count) |
Prepares a PWU_UNFDATA block for writing a new unformatted data record when the amount of data being written is known ahead of time. More... | |
PWP_UINT32 | PwuUnfRecBytes (PWU_UNFDATA *pUData) |
Get the running total number of bytes written to the current record during an unformatted file I/O session. More... | |
PWP_UINT32 | PwuUnfRecCount (PWU_UNFDATA *pUData) |
Get the running total number of finalized records written during an unformatted file I/O session. More... | |
PWP_BOOL | PwuUnfRecEnd (PWU_UNFDATA *pUData) |
Finalize the current record write. More... | |
PWP_BOOL | PwuUnfRecWriteArr (PWU_UNFDATA *pUData, const void *arr, size_t itemSize, size_t itemCnt) |
Write an array of data to the current record. More... | |
PWP_BOOL | PwuUnfRecWriteBuf (PWU_UNFDATA *pUData, const void *buf, size_t size) |
Write a data buffer to the current record. More... | |
PWP_BOOL | PwuUnfRecWriteEndianBuf (PWU_UNFDATA *pUData, const void *buf, size_t size) |
Write a data buffer to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteFLOAT (PWU_UNFDATA *pUData, PWP_FLOAT val) |
Write a PWP_FLOAT value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteINT (PWU_UNFDATA *pUData, PWP_INT val) |
Write a PWP_INT value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteINT16 (PWU_UNFDATA *pUData, PWP_INT16 val) |
Write a PWP_INT16 value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteINT32 (PWU_UNFDATA *pUData, PWP_INT32 val) |
Write a PWP_INT32 value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteINT64 (PWU_UNFDATA *pUData, PWP_INT64 val) |
Write a PWP_INT64 value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteINT8 (PWU_UNFDATA *pUData, PWP_INT8 val) |
Write a PWP_INT8 value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteREAL (PWU_UNFDATA *pUData, PWP_REAL val) |
Write a PWP_REAL value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteUINT (PWU_UNFDATA *pUData, PWP_UINT val) |
Write a PWP_UINT value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteUINT16 (PWU_UNFDATA *pUData, PWP_UINT16 val) |
Write a PWP_UINT16 value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteUINT32 (PWU_UNFDATA *pUData, PWP_UINT32 val) |
Write a PWP_UINT32 value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteUINT64 (PWU_UNFDATA *pUData, PWP_UINT64 val) |
Write a PWP_UINT64 value to the current record with endian order applied. More... | |
PWP_BOOL | PwuUnfRecWriteUINT8 (PWU_UNFDATA *pUData, PWP_UINT8 val) |
Write a PWP_UINT8 value to the current record with endian order applied. More... | |
PWP_UINT32 | PwuUnfTotRecBytes (PWU_UNFDATA *pUData) |
Get the running total number of bytes written to all records during an unformatted file I/O session. More... | |
static PwuString | PwuValueDefnAccessKey (const PwuString &rootGroup, const PwuString &valName) |
static PwuString | PwuValueDefnAttrGroup (const PwuString &rootGroup, const PwuString &valName) |
static PwuString | PwuValueDefnDefaultKey (const PwuString &rootGroup, const PwuString &valName) |
static PwuString | PwuValueDefnDescKey (const PwuString &rootGroup, const PwuString &valName) |
static PwuString | PwuValueDefnNameKey (const PwuString &rootGroup, const PwuString &valName) |
static PwuString | PwuValueDefnRangeKey (const PwuString &rootGroup, const PwuString &valName) |
static PwuString | PwuValueDefnsGroup (const PwuString &rootGroup) |
static PwuString | PwuValueDefnTypeKey (const PwuString &rootGroup, const PwuString &valName) |
static PwuString | PwuValueNamesGroup (const PwuString &rootGroup) |
PWP_BOOL | PwuValueSetBool (PWP_HVALUE hVal, PWP_BOOL val) |
PWP_BOOL | PwuValueSetEnum (PWP_HVALUE hVal, const char *val) |
PWP_BOOL | PwuValueSetInt (PWP_HVALUE hVal, PWP_INT val) |
PWP_BOOL | PwuValueSetReal (PWP_HVALUE hVal, PWP_REAL val) |
PWP_BOOL | PwuValueSetString (PWP_HVALUE hVal, const char *val) |
Set the value of a variable handle. More... | |
template<typename T , PWP_ENUM_VALTYPE TId> | |
static PWP_BOOL | PwuValueSetter (PWP_HVALUE hVal, T *val) |
PWP_BOOL | PwuValueSetUInt (PWP_HVALUE hVal, PWP_UINT val) |
static const char * | typeToString (PWP_ENUM_VALTYPE type) |
static PWP_BOOL | unfHdrLenWrite (PWU_UNFDATA *pUData) |
static PWP_BOOL | unfUDataInit (PWU_UNFDATA *pUData) |
Variables | |
static NamedStrings | namedStrings |
#define ENDIAN_MAXSIZE 32 |
#define STAT_BASE ((PWP_UINT32)(0x9ABCDEF0)) |
Definition at line 290 of file apiPWPUtils.cxx.
#define STAT_CLOSED ((PWP_UINT32)(STAT_BASE | 0x0)) |
Definition at line 292 of file apiPWPUtils.cxx.
#define STAT_MASK ((PWP_UINT32)(0xFFFFFFF0)) |
Definition at line 289 of file apiPWPUtils.cxx.
#define STAT_OPEN ((PWP_UINT32)(STAT_BASE | 0x1)) |
Definition at line 291 of file apiPWPUtils.cxx.
#define UDATA_INREC | ( | pUD | ) | (UDATA_ISOPEN(pUD) && (pUD)->inRec) |
Definition at line 296 of file apiPWPUtils.cxx.
#define UDATA_ISCLOSED | ( | pUD | ) | ((pUD) && (STAT_CLOSED == (pUD)->status)) |
Definition at line 297 of file apiPWPUtils.cxx.
Definition at line 294 of file apiPWPUtils.cxx.
#define UDATA_ISOPEN | ( | pUD | ) | ((pUD) && (STAT_OPEN == (pUD)->status) && (pUD)->fp && !(pUD)->hadError) |
Definition at line 295 of file apiPWPUtils.cxx.
typedef std::string PwuString |
Definition at line 18 of file apiPWPUtils.cxx.
|
static |
Definition at line 23 of file apiPWPUtils.cxx.
References pwpRtItem.
Referenced by PwuFindPublishedAPI(), and PwuFindTotalAPI().
Definition at line 730 of file apiPWPUtils.cxx.
Referenced by PwuAssignValue(), PwuGetValue(), PwuJoin(), PwuPublishValueDefinition(), PwuValueDefnAccessKey(), PwuValueDefnAttrGroup(), PwuValueDefnDefaultKey(), PwuValueDefnDescKey(), PwuValueDefnNameKey(), PwuValueDefnRangeKey(), PwuValueDefnsGroup(), PwuValueDefnTypeKey(), and PwuValueNamesGroup().
PwuString PwuJoin | ( | const PwuString & | j1, |
const PwuString & | j2, | ||
const PwuString & | j3, | ||
char | sepChar = '.' |
||
) |
Definition at line 763 of file apiPWPUtils.cxx.
References PwuJoin().
PwuString PwuJoin | ( | const PwuString & | j1, |
const PwuString & | j2, | ||
const PwuString & | j3, | ||
const PwuString & | j4, | ||
char | sepChar = '.' |
||
) |
Definition at line 771 of file apiPWPUtils.cxx.
References PwuJoin().
|
static |
Definition at line 143 of file apiPWPUtils.cxx.
References PwuSendMsg(), and PWP_MSG_PROGRESS::value.
Referenced by PwuProgressBegin(), PwuProgressEnd(), PwuProgressNextStep(), PwuProgressQuit(), and PwuProgressStatus().
|
static |
Definition at line 99 of file apiPWPUtils.cxx.
References PWP_MSG_TEXT::code, PwuSendMsg(), and PWP_MSG_TEXT::text.
Referenced by PwuSendDebugMsg(), PwuSendErrorMsg(), PwuSendInfoMsg(), and PwuSendWarningMsg().
|
static |
Definition at line 821 of file apiPWPUtils.cxx.
References PWU_VALUE_DEFN_ACCESS_STR, PwuJoin(), and PwuValueDefnAttrGroup().
Referenced by PwuPublishValueDefinition().
|
static |
Definition at line 795 of file apiPWPUtils.cxx.
References PwuJoin(), and PwuValueDefnsGroup().
Referenced by PwuValueDefnAccessKey(), PwuValueDefnDefaultKey(), PwuValueDefnDescKey(), PwuValueDefnNameKey(), PwuValueDefnRangeKey(), and PwuValueDefnTypeKey().
|
static |
Definition at line 839 of file apiPWPUtils.cxx.
References PWU_VALUE_DEFN_DEFAULT_STR, PwuJoin(), and PwuValueDefnAttrGroup().
Referenced by PwuPublishValueDefinition().
|
static |
Definition at line 830 of file apiPWPUtils.cxx.
References PWU_VALUE_DEFN_DESC_STR, PwuJoin(), and PwuValueDefnAttrGroup().
Referenced by PwuPublishValueDefinition().
|
static |
Definition at line 803 of file apiPWPUtils.cxx.
References PWU_VALUE_DEFN_NAME_STR, PwuJoin(), and PwuValueDefnAttrGroup().
Referenced by PwuPublishValueDefinition().
|
static |
Definition at line 848 of file apiPWPUtils.cxx.
References PWU_VALUE_DEFN_RANGE_STR, PwuJoin(), and PwuValueDefnAttrGroup().
Referenced by PwuPublishValueDefinition().
Definition at line 787 of file apiPWPUtils.cxx.
References PWU_PUBLISH_DEFNS_STR, and PwuJoin().
Referenced by PwuValueDefnAttrGroup().
|
static |
Definition at line 812 of file apiPWPUtils.cxx.
References PWU_VALUE_DEFN_TYPE_STR, PwuJoin(), and PwuValueDefnAttrGroup().
Referenced by PwuPublishValueDefinition().
Definition at line 779 of file apiPWPUtils.cxx.
References PWU_PUBLISH_NAMES_STR, and PwuJoin().
Referenced by PwuPublishValueDefinition().
Definition at line 1014 of file apiPWPUtils.cxx.
|
static |
Definition at line 967 of file apiPWPUtils.cxx.
References PWP_HVALUE_IMPL::dest_, PWP_FALSE, PWP_HVALUE_GET_IMPL, PWP_TRUE, and PWP_HVALUE_IMPL::PwpValueCB_.
|
static |
Definition at line 645 of file apiPWPUtils.cxx.
References PWP_VALTYPE_BOOL, PWP_VALTYPE_ENUM, PWP_VALTYPE_INT, PWP_VALTYPE_REAL, PWP_VALTYPE_STRING, and PWP_VALTYPE_UINT.
Referenced by PwuPublishValueDefinition().
|
static |
Definition at line 314 of file apiPWPUtils.cxx.
References PWU_UNFDATA::endianness, PWU_UNFDATA::fp, PWU_UNFDATA::hadError, PWP_FALSE, PWP_TRUE, pwpFileWrite(), PwuApplyEndianness(), PWU_UNFDATA::recBytes, and UDATA_INREC.
Referenced by PwuUnfRecBegin(), PwuUnfRecBeginFixed(), and PwuUnfRecEnd().
|
static |
Definition at line 302 of file apiPWPUtils.cxx.
References PWU_UNFDATA::endianness, PWP_ENDIAN_NATIVE, PWP_FALSE, PWP_TRUE, STAT_OPEN, and PWU_UNFDATA::status.
Referenced by PwuUnfFileBegin().
|
static |
Definition at line 725 of file apiPWPUtils.cxx.
Referenced by PwuAssignValue(), PwuGetValue(), and PwuPublishValueDefinition().