mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62950 954022d7-b5bf-4e40-9824-e11837661b57
52 lines
882 B
C++
52 lines
882 B
C++
|
|
|
|
#include "mediaitems_utils.h"
|
|
|
|
#include <boost/foreach.hpp>
|
|
#include <boost/lexical_cast.hpp>
|
|
|
|
namespace cpdoccore {
|
|
namespace odf_writer{
|
|
namespace utils {
|
|
|
|
namespace media {
|
|
|
|
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)
|
|
{
|
|
std::wstring sExt;
|
|
int n = uri.rfind(L".");
|
|
if (n>=0) sExt = uri.substr(n);
|
|
//todooo ïðîâåðèòü
|
|
|
|
return get_default_file_name(type) + boost::lexical_cast<std::wstring>(Num) + sExt;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|