#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include "toolbox.hpp"
#include <iostream>
#include <iomanip>
#include <sstream>
#include "errorhandler.hpp"
Go to the source code of this file.
Classes | |
union | FloatInt |
Internal: Structure for reading/writing a float as an UINT32. More... | |
Functions | |
std::string | convertMeterToFeetAndInch (double m) |
char | convertNibbleToHexChar (int value, bool useLowerCaseLetters) |
void | convertRGBtoHexString (UINT8 r, UINT8 g, UINT8 b, char *buffer) |
void | convertUINT8toHexString (UINT8 byte, char *buffer) |
std::string | doubleToString (double val, std::string::size_type digits_before_decimal_point, std::string::size_type digits_after_decimal_point) |
std::string | doubleToString (double val, int digits_after_decimal_point) |
UINT16 | fromString (const std::string &text) |
int | hexCharToValue (char c) |
std::string | ipAdrToString (UINT32 ipAddress) |
std::string | ipTargetToString (UINT32 ipAddress, UINT16 port) |
double | makeAngleValid (double angle) |
float | memread_float (BYTE *&buffer) |
INT16 | memread_INT16 (BYTE *&buffer) |
INT32 | memread_INT32 (BYTE *&buffer) |
std::string | memread_string (BYTE *&buffer, UINT16 length) |
UINT16 | memread_UINT16 (BYTE *&buffer) |
UINT32 | memread_UINT32 (BYTE *&buffer) |
UINT8 | memread_UINT8 (BYTE *&buffer) |
void | memwrite_float (BYTE *&buffer, float value) |
void | memwrite_INT16 (BYTE *&buffer, INT16 value) |
void | memwrite_INT32 (BYTE *&buffer, INT32 value) |
void | memwrite_INT8 (BYTE *&buffer, INT8 value) |
void | memwrite_string (BYTE *&buffer, std::string text) |
void | memwrite_UINT16 (BYTE *&buffer, UINT16 value) |
void | memwrite_UINT32 (BYTE *&buffer, UINT32 value) |
void | memwrite_UINT8 (BYTE *&buffer, UINT8 value) |
void | stringToIpTarget (std::string ipAdrStr, UINT32 &ipAddress, UINT16 &port) |
std::string | toHexString (UINT32 val) |
std::string | toHexString (UINT16 val) |
std::string | toHexString (UINT8 val) |
std::string | toHexStringNibble (UINT8 val) |
std::string | toLower (const std::string &text) |
std::string | toString (INT32 value) |
std::string | toString (UINT32 value) |
std::string | toString (double val, int digits_after_decimal_point) |
void | traceBuffer (std::string headerText, BYTE *buffer, UINT32 len) |
std::string convertMeterToFeetAndInch | ( | double | m | ) |
Definition at line 125 of file toolbox.cpp.
char convertNibbleToHexChar | ( | int | value, |
bool | useLowerCaseLetters | ||
) |
Konvertierung Zahlenwert -> Hex-Zeichen
Definition at line 197 of file toolbox.cpp.
void convertRGBtoHexString | ( | UINT8 | r, |
UINT8 | g, | ||
UINT8 | b, | ||
char * | buffer | ||
) |
Konvertiert drei UINT8-Werte (R, G, B) in einen HEX-String, z.B.: R = 0x12, G=0x34, B=0x56 --> String = "123456" Buffer muss mindestens 6 Byte gross sein.
Definition at line 240 of file toolbox.cpp.
void convertUINT8toHexString | ( | UINT8 | byte, |
char * | buffer | ||
) |
Konvertiert einen UINT8-Wert in einen 2-Byte-Hex-Wert, z.B.: b = 0x07, String = "07" Buffer muss mindestens 2 Byte gross sein.
Definition at line 227 of file toolbox.cpp.
std::string doubleToString | ( | double | val, |
std::string::size_type | digits_before_decimal_point, | ||
std::string::size_type | digits_after_decimal_point | ||
) |
Definition at line 307 of file toolbox.cpp.
std::string doubleToString | ( | double | val, |
int | digits_after_decimal_point | ||
) |
Konvertiere Double-Zahl in String.
Definition at line 344 of file toolbox.cpp.
UINT16 fromString | ( | const std::string & | text | ) |
Definition at line 158 of file toolbox.cpp.
int hexCharToValue | ( | char | c | ) |
Konvertierung eines Hex-Zeichens -> Zahlenwert.
Definition at line 173 of file toolbox.cpp.
std::string ipAdrToString | ( | UINT32 | ipAddress | ) |
Definition at line 424 of file toolbox.cpp.
std::string ipTargetToString | ( | UINT32 | ipAddress, |
UINT16 | port | ||
) |
Definition at line 407 of file toolbox.cpp.
double makeAngleValid | ( | double | angle | ) |
Bringt den Winkel in den Bereich ]PI..-PI]
Definition at line 252 of file toolbox.cpp.
float memread_float | ( | BYTE *& | buffer | ) |
Definition at line 523 of file toolbox.cpp.
INT16 memread_INT16 | ( | BYTE *& | buffer | ) |
Definition at line 474 of file toolbox.cpp.
INT32 memread_INT32 | ( | BYTE *& | buffer | ) |
Definition at line 485 of file toolbox.cpp.
std::string memread_string | ( | BYTE *& | buffer, |
UINT16 | length | ||
) |
Definition at line 498 of file toolbox.cpp.
UINT16 memread_UINT16 | ( | BYTE *& | buffer | ) |
Definition at line 453 of file toolbox.cpp.
UINT32 memread_UINT32 | ( | BYTE *& | buffer | ) |
Definition at line 439 of file toolbox.cpp.
UINT8 memread_UINT8 | ( | BYTE *& | buffer | ) |
Definition at line 464 of file toolbox.cpp.
void memwrite_float | ( | BYTE *& | buffer, |
float | value | ||
) |
Definition at line 534 of file toolbox.cpp.
void memwrite_INT16 | ( | BYTE *& | buffer, |
INT16 | value | ||
) |
Definition at line 567 of file toolbox.cpp.
void memwrite_INT32 | ( | BYTE *& | buffer, |
INT32 | value | ||
) |
Definition at line 545 of file toolbox.cpp.
void memwrite_INT8 | ( | BYTE *& | buffer, |
INT8 | value | ||
) |
Definition at line 595 of file toolbox.cpp.
void memwrite_string | ( | BYTE *& | buffer, |
std::string | text | ||
) |
Definition at line 604 of file toolbox.cpp.
void memwrite_UINT16 | ( | BYTE *& | buffer, |
UINT16 | value | ||
) |
Definition at line 576 of file toolbox.cpp.
void memwrite_UINT32 | ( | BYTE *& | buffer, |
UINT32 | value | ||
) |
Definition at line 554 of file toolbox.cpp.
void memwrite_UINT8 | ( | BYTE *& | buffer, |
UINT8 | value | ||
) |
Definition at line 586 of file toolbox.cpp.
void stringToIpTarget | ( | std::string | ipAdrStr, |
UINT32 & | ipAddress, | ||
UINT16 & | port | ||
) |
Definition at line 365 of file toolbox.cpp.
std::string toHexString | ( | UINT32 | val | ) |
Definition at line 71 of file toolbox.cpp.
std::string toHexString | ( | UINT16 | val | ) |
Definition at line 79 of file toolbox.cpp.
std::string toHexString | ( | UINT8 | val | ) |
Definition at line 89 of file toolbox.cpp.
std::string toHexStringNibble | ( | UINT8 | val | ) |
Definition at line 52 of file toolbox.cpp.
std::string toLower | ( | const std::string & | text | ) |
Definition at line 101 of file toolbox.cpp.
Definition at line 271 of file toolbox.cpp.
Definition at line 281 of file toolbox.cpp.
std::string toString | ( | double | val, |
int | digits_after_decimal_point | ||
) |
Definition at line 354 of file toolbox.cpp.
void traceBuffer | ( | std::string | headerText, |
BYTE * | buffer, | ||
UINT32 | len | ||
) |
Toolbox. Some useful functions.
Definition at line 20 of file toolbox.cpp.