Loading...
Searching...
No Matches
SimpleConverter.hpp
/*
* Open Chinese Convert
*
* Copyright 2010-2014 Carbo Kuo <byvoid@byvoid.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Export.hpp"
#include <memory>
#include <string>
#include <string_view>
#include <vector>
#ifndef __OPENCC_SIMPLECONVERTER_HPP_
#define __OPENCC_SIMPLECONVERTER_HPP_
#include "ConversionInspection.hpp"
#include "ResourceProvider.hpp"
namespace opencc {
struct ConfigLoadOptions;
class OPENCC_EXPORT SimpleConverter {
public:
explicit SimpleConverter(const std::string& configFileName);
SimpleConverter(const std::string& configFileName,
const ConfigLoadOptions& options);
SimpleConverter(const std::string& configFileName,
const std::vector<std::string>& paths);
SimpleConverter(const std::string& configFileName,
const std::vector<std::string>& paths,
const ConfigLoadOptions& options);
SimpleConverter(const std::string& configFileName,
const std::vector<std::string>& paths, const char* argv0);
SimpleConverter(const std::string& configFileName,
const std::vector<std::string>& paths, const char* argv0,
const ConfigLoadOptions& options);
SimpleConverter(const std::string& configFileName,
std::shared_ptr<ResourceProvider> provider);
SimpleConverter(const std::string& configFileName,
std::shared_ptr<ResourceProvider> provider,
const ConfigLoadOptions& options);
~SimpleConverter();
std::string Convert(const std::string& input) const;
std::string Convert(std::string_view input) const;
std::string Convert(const char* input) const;
std::string Convert(const char* input, size_t length) const;
size_t Convert(const char* input, char* output) const;
size_t Convert(const char* input, size_t length, char* output) const;
ConversionInspectionResult Inspect(std::string_view input) const;
private:
const void* internalData;
};
} // namespace opencc
#endif
opencc::SimpleConverter::Convert
std::string Convert(const std::string &input) const
Converts a text.
Definition SimpleConverter.cpp:129
opencc::SimpleConverter::Inspect
ConversionInspectionResult Inspect(std::string_view input) const
Inspects the conversion process for a given text.
Definition SimpleConverter.cpp:176
opencc::SimpleConverter::SimpleConverter
SimpleConverter(const std::string &configFileName)
Constructor of SimpleConverter.
Definition SimpleConverter.cpp:88
opencc::ConfigLoadOptions
Definition Config.hpp:26
opencc::ConversionInspectionResult
Full inspection result returned by Converter::Inspect().
Definition ConversionInspection.hpp:52