Open Chinese Convert: opencc::SimpleConverter Class Reference

Open Chinese Convert 1.2.0 A project for conversion between Traditional and Simplified Chinese

Loading...
Searching...
No Matches
Public Member Functions | List of all members
opencc::SimpleConverter Class Reference
OpenCC C++ Simple API

A high level converter This interface does not require C++11 to compile. More...

`#include <SimpleConverter.hpp>`

## Public Member Functions
| SimpleConverter (const std::string &configFileName)
| Constructor of SimpleConverter.
| SimpleConverter (const std::string &configFileName, const std::vector< std::string > &paths)
| Constructor of SimpleConverter.
| SimpleConverter (const std::string &configFileName, const std::vector< std::string > &paths, const char *argv0)
| Constructor of SimpleConverter.
std::string | Convert (const std::string &input) const
| Converts a text.
std::string | Convert (const char *input) const
| Converts a text.
std::string | Convert (const char *input, size_t length) const
| Converts a text.
size_t | Convert (const char *input, char *output) const
| Converts a text and writes to an allocated buffer Please make sure the buffer has sufficient space.
size_t | Convert (const char *input, size_t length, char *output) const
| Converts a text and writes to an allocated buffer Please make sure the buffer has sufficient space.

## Detailed Description

A high level converter This interface does not require C++11 to compile.

## Constructor & Destructor Documentation

## ◆ SimpleConverter() [1/3]

SimpleConverter::SimpleConverter | ( | const std::string & | configFileName | ) |
| explicit

Constructor of SimpleConverter.

Parameters

  configFileName | File name of configuration.

## ◆ SimpleConverter() [2/3]

SimpleConverter::SimpleConverter | ( | const std::string & | configFileName,
|  | const std::vector< std::string > & | paths )

Constructor of SimpleConverter.

Parameters

  configFileName | File name of configuration.
  paths | Additional paths to locate configuration and dictionary files.

## ◆ SimpleConverter() [3/3]

SimpleConverter::SimpleConverter | ( | const std::string & | configFileName,
|  | const std::vector< std::string > & | paths,
|  | const char * | argv0 )

Constructor of SimpleConverter.

Parameters

  configFileName | File name of configuration.
  paths | Additional paths to locate configuration and dictionary files.
  argv0 | Path of the executable (argv[0]), in addition to additional paths.

## Member Function Documentation

## ◆ Convert() [1/5]

std::string SimpleConverter::Convert | ( | const char * | input | ) | const

Converts a text.

Parameters

  input | A C-Style std::string (terminated by '\0') to be converted.

## ◆ Convert() [2/5]

size_t SimpleConverter::Convert | ( | const char * | input,
|  | char * | output ) const

Converts a text and writes to an allocated buffer Please make sure the buffer has sufficient space.

Parameters

  input | A C-Style std::string (terminated by '\0') to be converted.
  output | Buffer to write the converted text.

Returns
  Length of converted text.

## ◆ Convert() [3/5]

std::string SimpleConverter::Convert | ( | const char * | input,
|  | size_t | length ) const

Converts a text.

Parameters

  input | A C-Style std::string limited by a given length to be converted.
  length | Maximal length in byte of the input std::string.

## ◆ Convert() [4/5]

size_t SimpleConverter::Convert | ( | const char * | input,
|  | size_t | length,
|  | char * | output ) const

Converts a text and writes to an allocated buffer Please make sure the buffer has sufficient space.

Parameters

  input | A C-Style std::string limited by a given length to be converted.
  length | Maximal length in byte of the input std::string.
  output | Buffer to write the converted text.

Returns
  Length of converted text.

## ◆ Convert() [5/5]

std::string SimpleConverter::Convert | ( | const std::string & | input | ) | const

Converts a text.

Parameters

  input | Text to be converted.

The documentation for this class was generated from the following files:

- SimpleConverter.hpp
- SimpleConverter.cpp