LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
escaper.h
Go to the documentation of this file.
1// Copyright 2002-2019 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
17#ifndef LIMA_COMMON_MISC_ESCAPER_H
18#define LIMA_COMMON_MISC_ESCAPER_H
19
20#include <boost/format.hpp>
21#include <boost/algorithm/string.hpp>
22
23namespace Lima {
24
26{
27 template<typename FindResultT>
28 std::string operator()(const FindResultT& Match) const
29 {
30 std::string s;
31 for (typename FindResultT::const_iterator i = Match.begin();
32 i != Match.end();
33 i++) {
34 s += str(boost::format("\\x%02x") % static_cast<int>(*i));
35 }
36 return s;
37 }
38};
39
40}
41
42#endif
NAUTITIA.
std::string operator()(const FindResultT &Match) const
Definition escaper.h:28