Function write_table_header
Synopsis
#include <include/cpptoml.h>
void write_table_header(bool in_array=false)
Description
Write out the header of a table.
Source
Lines 3520-3563 in include/cpptoml.h.
void write_table_header(bool in_array = false)
{
if (!path_.empty())
{
indent();
write("[");
if (in_array)
{
write("[");
}
for (unsigned int i = 0; i < path_.size(); ++i)
{
if (i > 0)
{
write(".");
}
if (path_[i].find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
"fghijklmnopqrstuvwxyz0123456789"
"_-")
== std::string::npos)
{
write(path_[i]);
}
else
{
write("\"");
write(escape_string(path_[i]));
write("\"");
}
}
if (in_array)
{
write("]");
}
write("]");
endline();
}
}