Turi Create  4.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sframe_io.hpp
1 /* Copyright © 2017 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
5  */
6 #ifndef TURI_SFRAME_IO_HPP
7 #define TURI_SFRAME_IO_HPP
8 
9 #include<core/data/flexible_type/flexible_type.hpp>
10 #include<core/storage/serialization/oarchive.hpp>
11 
12 class JSONNode;
13 
14 namespace turi {
15 
16 
17 /**
18  * \ingroup sframe_physical
19  * \addtogroup sframe_main Main SFrame Objects
20  * \{
21  */
22 
23 /**
24  * Write a csv string of a vector of flexible_types (as a row in the sframe) to buffer.
25  * Return the number of bytes written.
26  */
27 size_t sframe_row_to_csv(const std::vector<flexible_type>& row, char* buf, size_t buflen);
28 
29 /**
30  * Write column_names and column_values (as a row in the sframe) to JSONNode.
31  */
32 void sframe_row_to_json(const std::vector<std::string>& column_names,
33  const std::vector<flexible_type>& column_values,
34  JSONNode& node);
35 
36 /// \}
37 }
38 
39 #endif
void sframe_row_to_json(const std::vector< std::string > &column_names, const std::vector< flexible_type > &column_values, JSONNode &node)
size_t sframe_row_to_csv(const std::vector< flexible_type > &row, char *buf, size_t buflen)