Envision
A visual programming IDE for object-oriented languages
Classes | Typedefs | Enumerations | Functions | Variables
FilePersistence Namespace Reference

Thes FilePersistence plug-in implements a file and a clipboard application tree stores based on XML. More...

Classes

class  addAndRename
 
class  AtomicCycleMoveDel
 
class  AtomicCycleMoveIns
 
class  AtomicCycleMoveMove
 
class  BothChangeSameList_Conflicts
 
class  ChangeDescription
 
class  ChangeGraph
 
struct  Chunk
 
class  Commit
 
struct  CommitFile
 
class  CommitGraph
 
struct  CommitGraphItem
 
struct  CommitMetaData
 
class  Conflicts
 
class  ConflictUnitComponent
 
class  CopyPartialToClipboard
 
class  CopyToClipboard
 
class  deletion
 
class  Dependencies
 
class  Diff
 
class  Diff3Parse
 
class  DiscardConflictingDeletesComponent
 The DiscardConflictingDeletesComponent detects subtrees which one branch removes entirely and another alters. More...
 
class  EvalClassMove
 
class  EvalLoopFix
 
class  EvalMethodInsert
 
class  FilePersistenceException
 
class  FilePersistencePlugin
 
class  FileUtil
 
class  GenericNode
 
class  GenericPersistentUnit
 
class  GenericTree
 TODO It might be good to separate trees with piecewise loaders and other "kinds" of trees into subclasses. More...
 
struct  GitCommitExtract
 
struct  GitDiffExtract
 
class  GitPiecewiseLoader
 
class  GitRepository
 
class  History
 
class  insert
 
class  intValueChange
 
class  ListMergeComponent
 
class  listReorder
 
class  ListsReorderInsertDeleteResolvable
 
class  LoadingFullList
 
class  LoadingPartialList
 
class  LoadingTypedList
 
class  LoadModeNodesSingleUnitOnly
 
class  LoadMultipleUnits
 
class  LoadRootOnly
 
class  Merge
 
class  MergeChange
 
struct  MergeData
 
class  MergePipelineComponent
 
class  MoveAndListChangesResolvable
 
class  MoveChangeBetweenListsResolvable
 
class  MoveChangeBySingleVersion
 
class  MoveCycleSimple
 
class  MoveInAndListChangesResolvable
 
class  MoveVsInsertConflict
 
class  noChange
 
struct  NodeData
 
class  parentChange
 
class  Parser
 
class  PasteBinaryFromClipboard
 
class  PasteInListFromClipboard
 
class  PasteListFromClipboard
 
class  PasteTextFromClipboard
 
class  PiecewiseLoader
 
struct  RelativePathData
 
class  RunMerge
 The RunMerge test is not an actual test but rather is used to run the merge algorithm on the repo found in /tmp/EnvisionVC/TestMerge. More...
 
class  SaveModeNodesSingleUnitOnly
 
class  SaveMultipleUnits
 
class  SaveRootOnly
 
class  SavingTypedList
 
struct  Signature
 
class  SimpleTextFileStore
 
class  SingleVersionChange
 
class  SoftConflict
 
class  stmtEdit
 
class  SystemClipboard
 
class  TwoChangesDifferentLists
 
class  TwoChangesDifferentLists_LabelCycle
 
class  TwoChangesSameList
 
class  TwoChangesSameList_DelInsNodes
 
class  TwoChangesSameList_LabelCycleResolvable
 
class  TwoDeletesInSameListResolvable
 
class  TwoDeletesNoConflict
 
class  typeChange
 
class  UnorderedAndUnitsConflicting
 
class  VCTestProject
 
class  XMLModel
 

Typedefs

using CommitFileContentDeleter = std::function< void(char *)>
 
using IdToChangeDescriptionHash = QMultiHash< Model::NodeIdType, std::shared_ptr< ChangeDescription > >
 
using IdToGenericNodeHash = QMultiHash< Model::NodeIdType, GenericNode * >
 

Enumerations

enum class  ChangeType { Unclassified , Insertion , Deletion , Move , Stationary }
 

Functions

static void createNodeAndAppend (const git_diff_line *line, const char *filePath, GenericTree *tree, QList< GenericNode * > &list)
 libgit callback More...
 
static int gitDiffExtractFileCallBack (const git_diff_delta *delta, float, void *carryAlongData)
 libgit callback More...
 
static int gitDiffExtractLineCallBack (const git_diff_delta *delta, const git_diff_hunk *, const git_diff_line *line, void *carryAlongData)
 libgit callback More...
 
uint qHash (const std::shared_ptr< const ChangeDescription > change, uint seed=0)
 
static int relativePathTreeWalkCallBack (const char *root, const git_tree_entry *entry, void *data)
 
static int treeWalkCommitExtractCallBack (const char *root, const git_tree_entry *entry, void *walkData)
 libgit callback: Tree Walk Callback More...
 

Variables

static const QString CLIPBOARD_TAG = "clipboard"
 
static const int MAX_DOUBLE_PRECISION = 15
 

Detailed Description

Thes FilePersistence plug-in implements a file and a clipboard application tree stores based on XML.

With the help of the SimpleTextFileStore class a tree can be stored as files on disk, where each persistence unit is saved to a different file. The precise data format is described below.

The SystemClipboard class provides access to the system clipboard. It offers functionality to copy a node or a list of nodes to the clipboard. Nodes are copied as an XML text which is described below. Nodes from the clipboard can be pasted into a node of a list type or can be used to replace other nodes in the tree.

Data persistence format

When application trees are stored on disk using the SimpleTextFileStore persistent store they are stored in a series of text files. To describe the format of these files we will use the simple application tree shown in the figure below.

A binary node hierarchy with a persistent unit

The image shows an application tree called units that contains 8 nodes. During the store operation each node is assigned a universally unique id (uuid) of the form {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} where each 'x' is a hex digit. In the documentation below we will use just integers as ids to simplify the presentation. The ids are indicated in the corresponding circle. Nodes 0,2,4 and 6 are of type BinaryNode. A binary node always has a name an optionally has a left and right nodes. The name is just a string. Node 2 in the figure is a persistence unit. Persistence units are saved in separate files by the SimpleTextFileStore class.

There is a master file which belongs to the main persistence unit (the application tree) and a file for each other persistence unit if any. Here is an example of a master file:

units BinaryNode {0xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
   name Text {1xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. S_root
   left persistencenewunit {2xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
   right BinaryNode {4xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
      name Text {5xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. S_second

Each line contains exactly one node from the tree. Child nodes are indented by tabs. The line defining a node has the following elements:

persistencenewunit is a special node which indicates that its content is defined in a different file. The type of this node is also defined in that file. The file name is the uuid of the file, inlcuding the braces. In the example above this filename is {2xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. Here is the content of that file:

left BinaryNodePersistenceUnit {2xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
   name Text {3xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. S_first
   left BinaryNode {6xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
      name Text {7xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. S_last

Its structure is identical to the one of the master file. top-level element which is absent. It is possible to have nested persistence unit nodes, in which case each new unit will be saved in its own file.

Format of the clipboard store

When using the ClipboardStore class provided by FilePersistence any copied nodes are stored as XML in the system clipboard. The format is equivalent to the one for persisting the tree on disk - we plan to unify the two in the future, they only diverge for historical reasons. Here is an example of two nodes being copied to clipboard:

<!DOCTYPE EnvisionFilePersistence>
<clipboard>
   <BinaryNode name="0" partial="0">
      <Text name="name" partial="0">S_first</Text>
   </BinaryNode>
   <BinaryNode name="1" partial="0">
      <Text name="name" partial="0">S_second</Text>
   </BinaryNode>
</clipboard>

The main element is clipboard and it contains one sub-element for each node that was copied. The structure of these sub-node elements is similar to the one discussed above, with the following differences:

Typedef Documentation

◆ CommitFileContentDeleter

using FilePersistence::CommitFileContentDeleter = typedef std::function<void (char*)>

◆ IdToChangeDescriptionHash

using FilePersistence::IdToChangeDescriptionHash = typedef QMultiHash<Model::NodeIdType, std::shared_ptr<ChangeDescription> >

◆ IdToGenericNodeHash

Enumeration Type Documentation

◆ ChangeType

Enumerator
Unclassified 
Insertion 
Deletion 
Move 
Stationary 

Function Documentation

◆ createNodeAndAppend()

static void FilePersistence::createNodeAndAppend ( const git_diff_line *  line,
const char *  filePath,
GenericTree tree,
QList< GenericNode * > &  list 
)
static

libgit callback

◆ gitDiffExtractFileCallBack()

static int FilePersistence::gitDiffExtractFileCallBack ( const git_diff_delta *  delta,
float  ,
void *  carryAlongData 
)
static

libgit callback

◆ gitDiffExtractLineCallBack()

static int FilePersistence::gitDiffExtractLineCallBack ( const git_diff_delta *  delta,
const git_diff_hunk *  ,
const git_diff_line *  line,
void *  carryAlongData 
)
static

libgit callback

◆ qHash()

uint FilePersistence::qHash ( const std::shared_ptr< const ChangeDescription change,
uint  seed = 0 
)
inline

◆ relativePathTreeWalkCallBack()

static int FilePersistence::relativePathTreeWalkCallBack ( const char *  root,
const git_tree_entry *  entry,
void *  data 
)
static

◆ treeWalkCommitExtractCallBack()

static int FilePersistence::treeWalkCommitExtractCallBack ( const char *  root,
const git_tree_entry *  entry,
void *  walkData 
)
static

libgit callback: Tree Walk Callback

Variable Documentation

◆ CLIPBOARD_TAG

const QString FilePersistence::CLIPBOARD_TAG = "clipboard"
static

◆ MAX_DOUBLE_PRECISION

const int FilePersistence::MAX_DOUBLE_PRECISION = 15
static