I'm just getting one big line, no CRLF in the archive. Makes it difficult
to debug.
Interesting thing is that I was seeing CRLF in a previous archive I created
in another app. There is no difference I can detect in the way I'm archiving
in this app.
Tool chain ...
g++ (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
libstdc++-4.9.2-6.fc21.x86_64
libstdc++-devel-4.9.2-6.fc21.x86_64
Code...
typedef std::multimap cnodemap_t;
typedef cnodemap_t::value_type cnpair_t;
typedef cnodemap_t::iterator cniterator_t;
typedef std::multimap qnodemap_t;
typedef qnodemap_t::value_type qnpair_t;
typedef qnodemap_t::iterator qniterator_t;
typedef qnodemap_t::reverse_iterator qnriterator_t;
struct qnode
{
qnode(){}
enum ctlflags flags;
std::string sname;
std::string stypnam;
std::string sdecl;
cnodemap_t parents;
cnodemap_t children;
template<class Archive>
void serialize(Archive &ar, const unsigned int version)
{
if (version){;}
ar & flags & sdecl & sname & parents & children;
}
};
class Cqnodemap
{
public:
Cqnodemap(){}
qnodemap_t qnmap;
template<class Archive>
void serialize(Archive &ar, const unsigned int version)
{
if (version){;}
ar & qnmap;
}
};
static inline void write_cqnmap(const char *filename, Cqnodemap& cqnmap)
{
ofstream ofs(filename, ofstream::out | ofstream::app);
if (!ofs.is_open()) {
cout << "Cannot open file: " << filename << endl;
exit(1);
}
{
boost::archive::text_oarchive oa(ofs);
oa << cqnmap;
}
ofs.close();
}