Files
core/ASCOfficeOdfFileW/source/OdfFormat/mediaitems_utils.cpp
Elen.Subbotina 871046d85a добавлена возможность создания embedded объектов.
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@56034 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-20 22:53:15 +03:00

55 lines
1.1 KiB
C++

#include "precompiled_cpodf.h"
#include "mediaitems_utils.h"
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <cpdoccore/common/boost_filesystem_version.h>
namespace cpdoccore {
namespace odf{
namespace utils {
namespace media {
using boost::filesystem::wpath;
std::wstring get_rel_type(_mediaitems::Type type)
{
switch (type)
{
case _mediaitems::typeImage:
return L"";
default:
return L"";
}
}
std::wstring get_default_file_name(_mediaitems::Type type)
{
switch (type)
{
case _mediaitems::typeImage:
return L"image";
default:
return L"media";
}
}
std::wstring create_file_name(const std::wstring & uri, _mediaitems::Type type, size_t Num)
{
#ifdef BOOST_FILESYSTEM_LEGACY
return get_default_file_name(type) + boost::lexical_cast<std::wstring>(Num) + wpath(uri).extension();
#else
return get_default_file_name(type) + boost::lexical_cast<std::wstring>(Num) + wpath(uri).extension().string<std::wstring>();
#endif
}
}
}
}
}