5e8fa6eb94
This change makes it possible to add a new backend without changing any of the core files. It also gets rid of some hacks (like -export-dynamic for the binary) by putting all core SyncEvolution code into a library. The transition is not quite complete: there are still some lists of existing backends, which will be removed soon. EvolutionSmartPtr.h and EvolutionSyncSource depend on Evolution/GNOME libs, which forces all backends to use the right -I flags. git-svn-id: https://zeitsenke.de/svn/SyncEvolution/trunk@684 15ad00c4-1369-45f4-8270-35d70d36bdcd
62 lines
2 KiB
C++
62 lines
2 KiB
C++
/*
|
|
* Copyright (C) 2008 Patrick Ohly
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
#ifndef INCL_EVOLUTION_FILE_CONFIG_TREE
|
|
# define INCL_EVOLUTION_FILE_CONFIG_TREE
|
|
|
|
#include <ConfigTree.h>
|
|
|
|
#include <string>
|
|
#include <map>
|
|
using namespace std;
|
|
|
|
/**
|
|
* This implementation maps nodes to plain .ini style files below an
|
|
* absolute directory of the filesystem. The caller is responsible for
|
|
* choosing that directory and how hidden and user-visible files are
|
|
* to be named.
|
|
*/
|
|
class FileConfigTree : public ConfigTree {
|
|
public:
|
|
/**
|
|
* @param root absolute filesystem path
|
|
* @param oldLayout use file names as in SyncEvolution <= 0.7
|
|
*/
|
|
FileConfigTree(const string &root,
|
|
bool oldLayout);
|
|
|
|
/* ConfigTree API */
|
|
virtual string getRootPath() const;
|
|
virtual void flush();
|
|
virtual void reset();
|
|
virtual boost::shared_ptr<ConfigNode> open(const string &path,
|
|
PropertyType type,
|
|
const string &otherId = string(""));
|
|
list<string> getChildren(const string &path);
|
|
|
|
private:
|
|
const string m_root;
|
|
const bool m_oldLayout;
|
|
|
|
typedef map< string, boost::shared_ptr<ConfigNode> > NodeCache_t;
|
|
/** cache of all nodes ever accessed */
|
|
NodeCache_t m_nodes;
|
|
};
|
|
|
|
#endif
|