void save_(BT_NODE *root, FILE *fp) { fputc('(', fp); if (NULL == root) { fputc(')', fp); return; } fputc(root->data, fp); save_(root->left, fp); save_(root->right, fp); fputc(')', fp); }
//树转广义表 int save(BT_NODE *root, const char *fname) { FILE *fp; fp = fopen(fname, "w"); if (NULL == fp) { return -1; } save_(root, fp); fclose(fp); return 0; }
void ToolDescriptionFile::store(const String & filename, const std::vector<Internal::ToolDescription> & tds) const { Internal::ToolDescriptionHandler handler(filename, schema_version_); handler.setToolDescriptions(tds); save_(filename, &handler); }
void DialogItemBinding_i::save() const { if (this) save_(); }
void MzQuantMLFile::store(const String & filename, const MSQuantifications & cmsq) const { Internal::MzQuantMLHandler handler(cmsq, filename, schema_version_, *this); save_(filename, &handler); }
void TraMLFile::store(const String & filename, const TargetedExperiment & exp) const { Internal::TraMLHandler handler(exp, filename, schema_version_, *this); save_(filename, &handler); }
void MzMLFile::store(const String& filename, const PeakMap& map) const { Internal::MzMLHandler handler(map, filename, getVersion(), *this); handler.setOptions(options_); save_(filename, &handler); }