#include "itkMacro.h"
#include <cstddef>
#include <array>
Go to the source code of this file.
|
| int | CheckVersion (const char header[ScancoHeaderField::VersionDiskWidth]) |
| |
| void | DateToString (const void *target, int year, int month, int day, int hour, int minute, int second, int millis) |
| |
| void | DecodeDate (const void *data, int &year, int &month, int &day, int &hour, int &minute, int &second, int &millis) |
| |
| double | DecodeDouble (const void *data) |
| |
| float | DecodeFloat (const void *data) |
| |
| int | DecodeInt (const void *data) |
| |
| int64_t | DecodeInt64 (const void *data) |
| |
| void | EncodeCurrentDate (void *target) |
| |
| void | EncodeDateFromString (void *target, const char dateString[ScancoHeaderField::DateStringBufferSize]) |
| |
| void | EncodeDouble (double data, void *target) |
| |
| void | EncodeFloat (float data, void *target) |
| |
| void | EncodeInt (int data, void *target) |
| |
| void | EncodeInt64 (int64_t data, void *target) |
| |
| void | GetCurrentDateString (void *target) |
| |
| void | PadString (char *dest, const char *source, vcl_size_t length) |
| |
| void | StripString (char *dest, const char *source, vcl_size_t length) |
| |
◆ ScancoGetConstMacro
| #define ScancoGetConstMacro |
( |
| name, |
|
|
| type ) |
Value: virtual type Get##name() const { return this->m_HeaderData.m_##name; } \
ITK_MACROEND_NOOP_STATEMENT
Definition at line 94 of file itkScancoDataManipulation.h.
◆ ScancoSetMacro
| #define ScancoSetMacro |
( |
| name, |
|
|
| type ) |
Value: virtual void Set##name(type _arg) \
{ \
itkDebugMacro("setting " #name " to " << _arg); \
ITK_GCC_PRAGMA_PUSH \
ITK_GCC_SUPPRESS_Wfloat_equal \
if (this->m_HeaderData.m_##name != _arg) \
{ \
this->m_HeaderData.m_##name = std::move(_arg); \
this->Modified(); \
} \
} \
ITK_MACROEND_NOOP_STATEMENT
#define ITK_GCC_PRAGMA_POP
Definition at line 98 of file itkScancoDataManipulation.h.
◆ CheckVersion()
| int CheckVersion |
( |
const char | header[ScancoHeaderField::VersionDiskWidth] | ) |
|
Check the file header to see what type of file it is.
- Parameters
-
| header | A pointer to the first 16 bytes of the file header. |
- Returns
- 0 if unrecognized, 1 if ISQ/RAD, 2 if AIM 020, 3 if AIM 030.
References ScancoHeaderField::VersionDiskWidth.
◆ DateToString()
| void DateToString |
( |
const void * | target, |
|
|
int | year, |
|
|
int | month, |
|
|
int | day, |
|
|
int | hour, |
|
|
int | minute, |
|
|
int | second, |
|
|
int | millis ) |
Formats a date into a string of the form DD-MMM-YYYY HH:MM:SS:mmm
- Parameters
-
| target | Pointer to a buffer of at least 32 bytes to store the formatted date string. |
| year | The year. |
| month | The month (1-12). |
| day | The day (1-31). |
| hour | The hour (0-23). |
| minute | The minute (0-59). |
| second | The second (0-59). |
| millis | The milliseconds (0-999). |
◆ DecodeDate()
| void DecodeDate |
( |
const void * | data, |
|
|
int & | year, |
|
|
int & | month, |
|
|
int & | day, |
|
|
int & | hour, |
|
|
int & | minute, |
|
|
int & | second, |
|
|
int & | millis ) |
Convert a VMS timestamp to a calendar date.
- Parameters
-
| data | Pointer to a buffer of at least 8 bytes containing the VMS timestamp. |
| year | The extracted Gregorian year. |
| month | The extracted Gregorian month (1-12). |
| day | The extracted Gregorian day (1-31). |
| hour | The extracted hour (0-23). |
| minute | The extracted minute (0-59). |
| second | The extracted second (0-59). |
| millis | The extracted milliseconds (0-999). |
◆ DecodeDouble()
| double DecodeDouble |
( |
const void * | data | ) |
|
Convert char data to float (double precision).
- Parameters
-
| data | Pointer to a buffer of at least 8 bytes. |
- Returns
- The decoded double value.
◆ DecodeFloat()
| float DecodeFloat |
( |
const void * | data | ) |
|
Convert char data to float (single precision).
- Parameters
-
| data | Pointer to a buffer of at least 4 bytes. |
- Returns
- The decoded float value.
◆ DecodeInt()
| int DecodeInt |
( |
const void * | data | ) |
|
Convert char data to 32-bit int (little-endian).
- Parameters
-
| data | Pointer to a buffer of at least 4 bytes. |
- Returns
- The decoded integer value.
◆ DecodeInt64()
| int64_t DecodeInt64 |
( |
const void * | data | ) |
|
Convert char data to 64-bit int (little-endian)
- Parameters
-
| data | Pointer to a buffer of at least 4 bytes. |
- Returns
- The decoded integer value.
◆ EncodeCurrentDate()
| void EncodeCurrentDate |
( |
void * | target | ) |
|
Convert the current calendar date to a VMS timestamp and store in target
- Parameters
-
| target | Pointer to a buffer of at least 8 bytes to store the VMS timestamp. |
◆ EncodeDateFromString()
| void EncodeDateFromString |
( |
void * | target, |
|
|
const char | dateString[ScancoHeaderField::DateStringBufferSize] ) |
Convert a calendar date to VMS timestamp
- Parameters
-
| target | Pointer to a buffer of at least 8 bytes to store the timestamp. |
| dateString | A string in the format "YYYY-MM-DD HH:MM:SS.mmm" |
References ScancoHeaderField::DateStringBufferSize.
◆ EncodeDouble()
| void EncodeDouble |
( |
double | data, |
|
|
void * | target ) |
◆ EncodeFloat()
| void EncodeFloat |
( |
float | data, |
|
|
void * | target ) |
Convert float data to char data.
- Parameters
-
| data | The float to convert. |
| target | Pointer to a buffer of at least 4 bytes to store the result. |
◆ EncodeInt()
| void EncodeInt |
( |
int | data, |
|
|
void * | target ) |
Convert 32-bit int (little-endian) to char data.
- Parameters
-
| data | The integer to convert. |
| target | Pointer to a buffer of at least 4 bytes to store the result. |
◆ EncodeInt64()
| void EncodeInt64 |
( |
int64_t | data, |
|
|
void * | target ) |
Convert 64-bit int (little-endian) to char data.
- Parameters
-
| data | The integer to convert. |
| target | Pointer to a buffer of at least 8 bytes to store the result. |
◆ GetCurrentDateString()
| void GetCurrentDateString |
( |
void * | target | ) |
|
Get the current date and time as a string in the format "YYYY-MM-DD HH:MM:SS.mmm".
- Parameters
-
| target | Pointer to a buffer of at least 32 bytes to store the current date string. |
◆ PadString()
| void PadString |
( |
char * | dest, |
|
|
const char * | source, |
|
|
vcl_size_t | length ) |
Pad a string with spaces to a specified length.
- Attention
- dest must have a size of at least l+1.
- Parameters
-
| dest | The destination string to be padded. |
| source | The source string to copy from. |
| length | The total length of the destination string after padding. |
◆ StripString()
| void StripString |
( |
char * | dest, |
|
|
const char * | source, |
|
|
vcl_size_t | length ) |
Strip a string by removing trailing whitespace.
- Attention
- dest must have a size of at least l+1.
- Parameters
-
| dest | The destination string to be stripped. |
| source | The source string to copy from. |
| length | The total length of the destination string. |
◆ ScancoHeaderBlockSize
| int ScancoHeaderBlockSize = 512 |
|
constexpr |