Open Chinese Convert  1.0.3
A project for conversion between Traditional and Simplified Chinese
opencc.h
00001 /*
00002  * Open Chinese Convert
00003  *
00004  * Copyright 2010-2014 BYVoid <byvoid@byvoid.com>
00005  *
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  *
00010  *      http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 
00019 #ifndef __OPENCC_H_
00020 #define __OPENCC_H_
00021 
00022 #ifdef __cplusplus
00023 
00024 #include <string>
00025 #include "Export.hpp"
00026 #include "SimpleConverter.hpp"
00027 
00028 extern "C" {
00029 #else
00030 #include <stddef.h>
00031 #endif
00032 
00033 #ifndef OPENCC_EXPORT
00034 #define OPENCC_EXPORT
00035 #endif
00036 
00048 #define OPENCC_DEFAULT_CONFIG_SIMP_TO_TRAD "s2t.json"
00049 
00055 #define OPENCC_DEFAULT_CONFIG_TRAD_TO_SIMP "t2s.json"
00056 
00062 typedef void* opencc_t;
00063 
00073 OPENCC_EXPORT opencc_t opencc_open(const char* configFileName);
00074 
00082 OPENCC_EXPORT int opencc_close(opencc_t opencc);
00083 
00098 OPENCC_EXPORT size_t opencc_convert_utf8_to_buffer(opencc_t opencc,
00099                                                    const char* input,
00100                                                    size_t length,
00101                                                    char* output);
00102 
00118 OPENCC_EXPORT char* opencc_convert_utf8(opencc_t opencc,
00119                                         const char* input,
00120                                         size_t length);
00121 
00129 OPENCC_EXPORT void opencc_convert_utf8_free(char* str);
00130 
00138 OPENCC_EXPORT const char* opencc_error(void);
00139 
00140 #ifdef __cplusplus
00141 } // extern "C"
00142 #endif
00143 
00150 #endif
 All Classes Functions