Files
core/ASCOfficeOdfFileW/source/OdfFormat/mediaitems_utils.cpp
Elen.Subbotina b162d7c60e текстурные заливки объектов
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55825 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-20 22:52:08 +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
}
}
}
}
}