Back to index

texmacs  1.0.7.15
Functions
tmfs_versioning.cpp File Reference
#include "tmfs.hpp"
#include "scheme.hpp"

Go to the source code of this file.

Functions

string tmfs_create_identifier ()
string tmfs_create_ressource ()
string tmfs_create_version (string ressource)
void tmfs_save_version_file (string version, string contents)
void tmfs_save_version_properties (string version, properties props)
string tmfs_load_version_file (string version)
properties tmfs_load_version_properties (string version)
void tmfs_set_head (string ressource, string version)
void tmfs_reset_head (string ressource)
string tmfs_get_head (string ressource)
collection tmfs_get_versions (string ressource)
void tmfs_save_ressource (string ressource, string contents, properties ps)
string tmfs_load_ressource_file (string ressource)
properties tmfs_load_ressource_properties (string ressource)

Function Documentation

Definition at line 20 of file tmfs_versioning.cpp.

                          {
  return as_string (call ("create-unique-id"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 25 of file tmfs_versioning.cpp.

                         {
  return tmfs_create_identifier ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 30 of file tmfs_versioning.cpp.

                                       {
  string id  = tmfs_create_identifier ();
  string head= tmfs_get_head (ressource);
  tmfs_set_property (seq ("version", id, ressource));
  if (head != "") tmfs_set_property (seq ("next", head, id));
  return id;
}

Here is the call graph for this function:

Here is the caller graph for this function:

string tmfs_get_head ( string  ressource)

Definition at line 80 of file tmfs_versioning.cpp.

                                 {
  solutions sols= tmfs_get_solutions (seq ("head", ressource, "?v"));
  collection c= as_collection (sols, "?v");
  if (N(c) == 0) return "";
  return first (c);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 88 of file tmfs_versioning.cpp.

                                     {
  solutions sols= tmfs_get_solutions (seq ("version", "?v", ressource));
  return as_collection (sols, "?v");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 102 of file tmfs_versioning.cpp.

                                            {
  string version= tmfs_get_head (ressource);
  if (version == "") return "";
  return tmfs_load_version_file (version);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 109 of file tmfs_versioning.cpp.

                                                  {
  string version= tmfs_get_head (ressource);
  if (version == "") return properties ();
  return tmfs_load_version_properties (version);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 49 of file tmfs_versioning.cpp.

                                        {
  return tmfs_load (version);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 54 of file tmfs_versioning.cpp.

                                              {
  return properties_decode (tmfs_load (version * "!"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_reset_head ( string  ressource)

Definition at line 75 of file tmfs_versioning.cpp.

                                   {
  tmfs_set_head (ressource, "");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_save_ressource ( string  ressource,
string  contents,
properties  ps 
)

Definition at line 94 of file tmfs_versioning.cpp.

                                                                       {
  string version= tmfs_create_version (ressource);
  tmfs_save_version_file (version, contents);
  tmfs_save_version_properties (version, ps);
  tmfs_set_head (ressource, version);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_save_version_file ( string  version,
string  contents 
)

Definition at line 39 of file tmfs_versioning.cpp.

                                                         {
  if (contents != "") tmfs_save (version, contents);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_save_version_properties ( string  version,
properties  props 
)

Definition at line 44 of file tmfs_versioning.cpp.

                                                                {
  tmfs_save (version * "!", properties_encode (props));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_set_head ( string  ressource,
string  version 
)

Definition at line 59 of file tmfs_versioning.cpp.

                                                 {
  string head= tmfs_get_head (ressource);
  if (ressource == head) return;
  if (head != "") {
    tmfs_reset_property (seq ("head", ressource, head));
    properties props= tmfs_load_version_properties (head);
    tmfs_reset_properties (props);
  }
  if (version != "") {
    tmfs_set_property (seq ("head", ressource, version));
    properties props= tmfs_load_version_properties (version);
    tmfs_set_properties (props);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function: