Back to index

texmacs  1.0.7.15
Classes | Functions
new_data.hpp File Reference
#include "tree.hpp"
#include "hashmap.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  new_data_rep
class  new_data

Functions

 CONCRETE_CODE (new_data)
tree attach_data (tree body, new_data data, bool no_aux=false)
tree detach_data (tree doc, new_data &data)

Function Documentation

tree attach_data ( tree  body,
new_data  data,
bool  no_aux = false 
)

Definition at line 18 of file new_data.cpp.

                                                    {
  tree doc (DOCUMENT);
  doc << compound ("TeXmacs", TEXMACS_VERSION);
  if (data->project != "")
    doc << compound ("project", copy (data->project));
  if (data->style != tree (TUPLE))
    doc << compound ("style", copy (data->style));
  if (body != tree (DOCUMENT, ""))
    doc << compound ("body", body);
  if (N (data->init) != 0)
    doc << compound ("initial", make_collection (data->init));
  if (N (data->fin) != 0)
    doc << compound ("final", make_collection (data->fin));
  if (!no_aux) {
    if (N (data->ref) != 0)
      doc << compound ("references", make_collection (data->ref));
    if (N (data->aux) != 0)
      doc << compound ("auxiliary", make_collection (data->aux));
  }
  //object arg1 (data->buffer_name);
  //object arg2 (body);
  //tree links= as_tree (call ("get-link-locations", arg1, arg2));
  //if (N (links) != 0)
  //  doc << compound ("links", links);
  return doc;  
}

Here is the call graph for this function:

Here is the caller graph for this function:

tree detach_data ( tree  doc,
new_data data 
)

Definition at line 46 of file new_data.cpp.

                                       {
  data->project= extract (doc, "project");
  data->style  = extract (doc, "style");
  data->init   = hashmap<string,tree> (UNINIT, extract (doc, "initial"));
  data->fin    = hashmap<string,tree> (UNINIT, extract (doc, "final"));
  data->ref    = hashmap<string,tree> (UNINIT, extract (doc, "references"));
  data->aux    = hashmap<string,tree> (UNINIT, extract (doc, "auxiliary"));
  //tree links= extract (doc, "links");
  //if (N (links) != 0)
  //  (void) call ("register-link-locations", object (u), object (links));
  return extract (doc, "body");
}

Here is the call graph for this function:

Here is the caller graph for this function: