mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-18 21:21:23 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53593 954022d7-b5bf-4e40-9824-e11837661b57
65 lines
1.2 KiB
C++
65 lines
1.2 KiB
C++
|
|
// auto inserted precompiled begin
|
|
#include "precompiled_docxformat.h"
|
|
// auto inserted precompiled end
|
|
|
|
#include "ItemProps.h"
|
|
#include "FileTypes.h"
|
|
|
|
|
|
namespace OOX
|
|
{
|
|
|
|
ItemProps::ItemProps()
|
|
{
|
|
}
|
|
|
|
|
|
ItemProps::ItemProps(const boost::filesystem::wpath& filename)
|
|
{
|
|
read(filename);
|
|
}
|
|
|
|
|
|
ItemProps::~ItemProps()
|
|
{
|
|
}
|
|
|
|
|
|
void ItemProps::read(const boost::filesystem::wpath& filename)
|
|
{
|
|
const XML::XDocument document(filename);
|
|
Refs = document.Root.element("schemaRefs");
|
|
ItemID = document.Root.attribute("itemID").value();
|
|
}
|
|
|
|
|
|
void ItemProps::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const
|
|
{
|
|
XML::XElement(ns.ds + "datastoreItem",
|
|
XML::XAttribute(ns.ds + "itemID", ItemID) +
|
|
XML::Write(Refs)
|
|
).Save(filename);
|
|
|
|
content.registration(type().OverrideType(), directory, filename);
|
|
}
|
|
|
|
|
|
const FileType ItemProps::type() const
|
|
{
|
|
return FileTypes::ItemProp;
|
|
}
|
|
|
|
|
|
const boost::filesystem::wpath ItemProps::DefaultDirectory() const
|
|
{
|
|
return type().DefaultDirectory();
|
|
}
|
|
|
|
|
|
const boost::filesystem::wpath ItemProps::DefaultFileName() const
|
|
{
|
|
return type().DefaultFileName();
|
|
}
|
|
|
|
} // namespace OOX
|