mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-20 07:41:12 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53593 954022d7-b5bf-4e40-9824-e11837661b57
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#pragma once
|
|
#ifndef UTILITY_UTILITY_INCLUDE_H_
|
|
#define UTILITY_UTILITY_INCLUDE_H_
|
|
|
|
#include "DateTime.h"
|
|
#include "Parse.h"
|
|
#include "ToString.h"
|
|
#include "Unit.h"
|
|
#include "Encoding.h"
|
|
#include "TxtFile.h"
|
|
#include <boost/foreach.hpp>
|
|
#include "UniversalUnit.h"
|
|
#include "FileNameUtility.h"
|
|
|
|
|
|
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;
|
|
BOOST_FOREACH(const In& line, lines)
|
|
{
|
|
result.push_back(func(line));
|
|
}
|
|
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;
|
|
BOOST_FOREACH(const In& line, lines)
|
|
{
|
|
result.push_back(func(line));
|
|
}
|
|
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;
|
|
BOOST_FOREACH(const In& line, lines)
|
|
{
|
|
result.push_back(func(line, codepage));
|
|
}
|
|
return result;
|
|
}
|
|
#endif // UTILITY_UTILITY_INCLUDE_H_
|