mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 09:24:40 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62392 954022d7-b5bf-4e40-9824-e11837661b57
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "../../../../Common/DocxFormat/Source/XML/stringcommon.h"
|
|
#include "../Common/Encoding.h"
|
|
#include <vector>
|
|
|
|
template<typename Out, typename In>
|
|
static const std::vector<Out> _transform(const std::vector<In>& lines, const Out(*func)(const In&))
|
|
{
|
|
std::vector<Out> result;
|
|
for (typename std::vector<In>::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
|
|
{
|
|
result.push_back(func(*iter));
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
template<typename Out, typename In>
|
|
static const std::list<Out> _transform(const std::list<In>& lines, const Out(*func)(const In&))
|
|
{
|
|
std::list<Out> result;
|
|
for (typename std::list<In>::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
|
|
{
|
|
result.push_back(func(*iter));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
template<typename Out, typename In, typename In2>
|
|
static const std::list<Out> _transform2(const std::list<In>& lines, const int codepage, const Out(*func)(const In&, const In2 codePage))
|
|
{
|
|
std::list<Out> result;
|
|
for (typename std::list<In>::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
|
|
{
|
|
result.push_back(func(*iter, codepage));
|
|
}
|
|
return result;
|
|
}
|
|
|