本文整理汇总了C++中Checker::ChkCoding方法的典型用法代码示例。如果您正苦于以下问题:C++ Checker::ChkCoding方法的具体用法?C++ Checker::ChkCoding怎么用?C++ Checker::ChkCoding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checker
的用法示例。
在下文中一共展示了Checker::ChkCoding方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc,char **argv){
FILE *fin;
if((fin = fopen("zenkana.sjis","r")) == NULL){
printf("File open Error.\n");
exit(255);
}
char *inputstring = new char[1024];
fscanf(fin,"%s",inputstring);
strcat(inputstring,"\n");
Checker *ip = new FastChecker();
printf("%d",ip->ChkCoding((unsigned char*)inputstring));
delete ip;
fclose(fin);
return(0);
}
示例2:
static PyObject*
CallChecker(PyObject *self, PyObject *args)
{
unsigned char *str;
int type;
int len;
Codes ret;
PyObject *pret;
Checker *op;
if(!PyArg_ParseTuple(args, "is#", &type, &str, &len)){
return NULL;
}
op = CheckerTable[type]();
ret = op->ChkCoding(str, len);
pret = Py_BuildValue("i", ret);
delete op;
return pret;
};
示例3: return
PyObject * kconv_mod_ChkCoding(PyObject *self,PyObject *args,PyObject *keywds){
//デフォルト値の読み込み。一度だけ行なう
if(_DEFAULT_INPUT_CODING == _UNKNOWN)
_load_defaults();
int cm = _UNDEFINED;
unsigned char *input_string;
unsigned int string_length;
static char *kwlist[] = {"str",
"checkmode",
NULL};
if(!PyArg_ParseTupleAndKeywords(args,keywds,"s#|i",kwlist,
&input_string,&string_length,&cm))
return NULL;
//デフォルトの値設定
if(cm == _UNDEFINED)//入力コード判別ルーチン選択
cm = _DEFAULT_CHECK_MODE;
Checker *pchecker = CheckerTable[cm]();
Codes ret = pchecker->ChkCoding(input_string,string_length);
delete pchecker;
return(Py_BuildValue("i",ret));
}