You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Part of sqlite3pp::TableOStream interface. Required if using TableOStream container or operator<<(). To exclude TableOStream interface, set exclude_ostream_operator to true when creating this class through SQLiteClassBuilder.
// These constructors are only useful if method setData is created.
655
+
myfile << "\t" << ClassName << "() {}"; // Allow default constructor to still work
656
+
if (!m_options.m.exclude_comments)
657
+
myfile << " // Default constructor";
658
+
myfile << std::endl;
659
+
myfile << "\ttemplate <class T> " << ClassName << "(const T &t) { setData(t); }"; // This constructor allows data transfer from different tables/views having same data types and column names
660
+
if (!m_options.m.exclude_comments)
661
+
myfile << " // Allows data input from different (or same) tables/views having the same data types and column names";
662
+
myfile << std::endl;
663
+
629
664
if (!m_options.m.exclude_comments)
630
665
myfile << "\n\t// getTableName, getColumnNames, getSelecColumnNames, and getStreamData are required for sqlite3pp::Table template class" << std::endl;
631
-
// Create getTableName member function. It's needed for sqlite3pp::Table template class
666
+
667
+
// Create getTableName member function. Needed for sqlite3pp::Table template class
// Create setData member function. Used to transfer data from different tables/views having same data types and column names
689
+
myfile << "\ttemplate <class T> void setData(const T &t) // Used to transfer data from different tables/views having same data types and column names\n\t{" << std::endl;
constchar* OperatorStreamComment = "// Optional logic for operator<<(). Set exclude_ostream_operator to true to exclude operator<<() logic when creating this class through SQLiteClassBuilder.\n";
731
+
const std::string OperatorStreamComment1 = "/* sqlite3pp::TableOStream container interface.\n\tFunctions OStream(), operator<<(), and Delimiter() are required when using the sqlite3pp::TableOStream container.\n\tExample Usage:\t\t(Using sqlite3pp::TableOStream container)\n\t\t\tTableOStream<" + ClassName + "> tbl(DbFileNameArg(\"mydatabase.db\"));\n\t\t\ttbl.setDelimit(\"|\"); // Change delimiter\n\t\t\tstd::cout << tbl; // Send data to screen with the changed delimiter\n\n\t\t\tstd::ofstream ofs (\"data.csv\", std::ofstream::out);\n\t\t\ttbl.setDelimit(\",\"); // Change delimiter\n\t\t\tofs << tbl; // Write data to a CSV file using the changed \",\" delimiter.\n\n\t\t\ttbl.out(std::cout); // Send data to screen using out() member function.\n\tTo exclude TableOStream interface, set exclude_ostream_operator to true when creating this class using SQLiteClassBuilder.\n\t*/\n";
0 commit comments