DataCSV.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright (c) 2014-2020 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #ifndef DATA_CVS_H
14 #define DATA_CVS_H
15 
16 #include <string>
17 #include <map>
18 #include <regex>
19 
20 #include "com_manager.h"
21 
22 using namespace std;
23 
24 #define IS_DATA_MAPPING_MAX_STRING_LENGTH 2048
25 
26 typedef enum
27 {
40 
42 } eDataType;
43 
44 /*
45 * Metadata about a specific field
46 */
47 typedef struct
48 {
49  uint32_t dataOffset;
50  uint32_t dataSize;
52  string name;
53 } data_info_t;
54 
55 class cDataCSV
56 {
57 public:
58  int WriteHeaderToFile(FILE* pFile, uint32_t id);
59  int ReadHeaderFromFile(FILE* pFile, uint32_t id, vector<data_info_t>& columnHeaders);
60  int WriteDataToFile(uint64_t orderId, FILE* pFile, const p_data_hdr_t& dataHdr, const uint8_t* dataBuf);
61 
70  bool StringCSVToData(string& s, p_data_hdr_t& hdr, uint8_t* buf, uint32_t bufSize, const vector<data_info_t>& columnHeaders);
71 
78  bool DataToStringCSV(const p_data_hdr_t& hdr, const uint8_t* buf, string& csv);
79 };
80 
81 #endif // DATA_CVS_H
uint32_t dataSize
Definition: DataCSV.h:50
uint32_t dataOffset
Definition: DataCSV.h:49
XmlRpcServer s
string name
Definition: DataCSV.h:52
eDataType dataType
Definition: DataCSV.h:51
eDataType
Definition: DataCSV.h:26


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04