/usr/include/choreonoid-1.1/cnoid/src/Base/Archive.h is in libcnoid-dev 1.1.0+dfsg-6.1+b4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | /**
@author Shin'ichiro Nakaoka
*/
#ifndef CNOID_GUIBASE_GUIBASE_ARCHIVE_H_INCLUDED
#define CNOID_GUIBASE_GUIBASE_ARCHIVE_H_INCLUDED
#include <cnoid/YamlNodes>
#include <string>
#include <boost/function.hpp>
#include "exportdecl.h"
namespace cnoid {
class Item;
typedef boost::intrusive_ptr<Item> ItemPtr;
class Archive;
typedef boost::intrusive_ptr<Archive> ArchivePtr;
class ArchiveSharedData;
class CNOID_EXPORT Archive : public YamlMapping
{
public:
Archive();
Archive(int line, int column);
virtual ~Archive();
void initSharedInfo(const std::string& projectFile);
void inheritSharedInfoFrom(ArchivePtr archive);
void addPostProcess(const boost::function<void()>& func) const;
Archive* findSubArchive(const std::string& name);
//int getItemId(Item* item) const;
int getItemId(ItemPtr item) const;
Item* findItem(int id) const;
template<class ItemType> inline ItemType* findItem(int id) const {
return dynamic_cast<ItemType*>(findItem(id));
}
void writeItemId(const std::string& key, ItemPtr item);
template<class ItemType> inline ItemType* findItem(const std::string& key) const {
int id;
return read(key, id) ? findItem<ItemType>(id) : 0;
}
bool readRelocatablePath(const std::string& key, std::string& out_value) const;
void writeRelocatablePath(const std::string& key, const std::string& path);
Item* currentParentItem() const;
private:
boost::intrusive_ptr<ArchiveSharedData> shared;
void setCurrentParentItem(Item* parentItem);
static ArchivePtr invalidArchive();
void registerItemId(Item* item, int id);
// called from ItemTreeArchiver
void callPostProcesses();
friend class ItemTreeArchiver;
friend class ProjectManagerImpl;
};
}
#endif
|