From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_csv_reader_8cpp_source.xhtml | 121 ++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 20.02/_csv_reader_8cpp_source.xhtml (limited to '20.02/_csv_reader_8cpp_source.xhtml') diff --git a/20.02/_csv_reader_8cpp_source.xhtml b/20.02/_csv_reader_8cpp_source.xhtml new file mode 100644 index 0000000000..6245969936 --- /dev/null +++ b/20.02/_csv_reader_8cpp_source.xhtml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + +ArmNN: src/armnnUtils/CsvReader.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
CsvReader.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "CsvReader.hpp"
7 
8 #include <boost/algorithm/string.hpp>
9 #include <boost/tokenizer.hpp>
10 
11 #include <fstream>
12 #include <string>
13 #include <vector>
14 
15 using Tokenizer = boost::tokenizer<boost::escaped_list_separator<char>>;
16 
17 namespace armnnUtils
18 {
19 
20 CsvRow ParseLine(const std::string& csvLine)
21 {
22  Tokenizer tokenizer(csvLine);
23  CsvRow entry;
24 
25  for (const auto &token : tokenizer)
26  {
27  entry.values.push_back(boost::trim_copy(token));
28  }
29  return entry;
30 }
31 
32 std::vector<CsvRow> CsvReader::ParseFile(const std::string& csvFile)
33 {
34  std::vector<CsvRow> result;
35 
36  std::ifstream in(csvFile.c_str());
37  if (!in.is_open())
38  return result;
39 
40  std::string line;
41  while (getline(in, line))
42  {
43  if(!line.empty())
44  {
45  CsvRow entry = ParseLine(line);
46  result.push_back(entry);
47  }
48  }
49  return result;
50 }
51 
52 std::vector<CsvRow> CsvReader::ParseVector(const std::vector<std::string>& csvVector)
53 {
54  std::vector<CsvRow> result;
55 
56  for (auto const& line: csvVector)
57  {
58  CsvRow entry = ParseLine(line);
59  result.push_back(entry);
60  }
61  return result;
62 }
63 } // namespace armnnUtils
std::vector< std::string > values
Definition: CsvReader.hpp:15
+ +
static std::vector< CsvRow > ParseVector(const std::vector< std::string > &csvVector)
Definition: CsvReader.cpp:52
+
boost::tokenizer< boost::escaped_list_separator< char > > Tokenizer
Definition: CsvReader.cpp:15
+ +
static std::vector< CsvRow > ParseFile(const std::string &csvFile)
Definition: CsvReader.cpp:32
+ +
CsvRow ParseLine(const std::string &csvLine)
Definition: CsvReader.cpp:20
+
+
+ + + + -- cgit v1.2.1