您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wide_string_to_UTF8函数代码示例

51自学网 2021-06-03 09:56:25
  C++
这篇教程C++ wide_string_to_UTF8函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wide_string_to_UTF8函数的典型用法代码示例。如果您正苦于以下问题:C++ wide_string_to_UTF8函数的具体用法?C++ wide_string_to_UTF8怎么用?C++ wide_string_to_UTF8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wide_string_to_UTF8函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: isNamedEmptyMatrix

bool isNamedEmptyMatrix(const wchar_t* _pstName){	bool bEmpty = false;	if (_pstName)	{		char *varname = wide_string_to_UTF8(_pstName);		if (varname)		{			bEmpty = dynlib_isNamedEmptyMatrix(pvApiCtx, varname) == 1 ? true : false;			delete varname;			varname = NULL;		}	}	return bEmpty;}
开发者ID:qchartist,项目名称:QChartist,代码行数:15,


示例2: isNamedVarExist

bool isNamedVarExist(const wchar_t* _pstName){	int iExist = 0;	if (_pstName)	{		char *varname = wide_string_to_UTF8(_pstName);		if (varname)		{			iExist = dynlib_isNamedVarExist(pvApiCtx, varname);			delete [] varname;			varname = NULL;		}	}	return (iExist == 1 ? true : false);}
开发者ID:qchartist,项目名称:QChartist,代码行数:15,


示例3: getNamedMatrixOfDouble

bool getNamedMatrixOfDouble(const wchar_t* _pstName, int* _piRows, int* _piCols, double* _pdblReal){	if (_pstName)	{		char *varname = wide_string_to_UTF8(_pstName);		if (varname)		{			SciErr sciErr = dynlib_readNamedMatrixOfDouble(pvApiCtx, varname, _piRows, _piCols, _pdblReal);			delete [] varname;			varname = NULL;			return (sciErr.iErr == 0 ? true : false);		}	}	return false;}
开发者ID:qchartist,项目名称:QChartist,代码行数:15,


示例4: scistrrev

/*----------------------------------------------------------------------------*/char* scistrrev(char* str){    char *revstr = NULL;    if (str)    {        wchar_t *wcstr = to_wide_string(str);#ifdef _MSC_VER        wchar_t *wcrevstr = _wcsrev(wcstr);        revstr = wide_string_to_UTF8(wcrevstr);#else        int i = 0;        int t = 0;        int j = 0, k = 0;        if (wcstr)        {            i = (int)wcslen(wcstr);        }        t = !(i % 2) ? 1 : 0;   // check the length of the string .        /* copy character by character to reverse string */        k = 0;        for (j = i - 1; j > (i / 2 - t) ; j-- )        {            /* j starts from end of string */            /* k starts from beginning of string */            wchar_t ch  = wcstr[j]; /* ch temp. character */            wcstr[j]   = wcstr[k]; /* end and beginning characters are exchanged */            wcstr[k++] = ch;        }        revstr = wide_string_to_UTF8(wcstr);#endif        FREE(wcstr);    }    return revstr;}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:37,


示例5: getNamedScalarDouble

bool getNamedScalarDouble(const wchar_t* _pstName, double* _pdblReal){	int iErr = -1;	if (_pstName)	{		char *varname = wide_string_to_UTF8(_pstName);		if (varname)		{			iErr = dynlib_getNamedScalarDouble(pvApiCtx, varname, _pdblReal);			delete [] varname;			varname = NULL;		}	}	return (iErr == 0 ? true : false);}
开发者ID:qchartist,项目名称:QChartist,代码行数:15,


示例6: createNamedScalarBoolean

bool createNamedScalarBoolean(const wchar_t* _pstName, bool _bool){	int iErr = -1;	if (_pstName)	{		char *varname = wide_string_to_UTF8(_pstName);		if (varname)		{			iErr = dynlib_createNamedScalarBoolean(pvApiCtx, varname, (_bool == true) ? TRUE : FALSE);			delete [] varname;			varname = NULL;		}	}	return (iErr == 0 ? true : false);}
开发者ID:qchartist,项目名称:QChartist,代码行数:15,


示例7: defined

/*--------------------------------------------------------------------------*/wchar_t *get_full_pathW(wchar_t * _wcFullPath, const wchar_t * _wcPath, size_t _SizeInBytes){    wchar_t *wcResult = NULL;#if defined(_MSC_VER)    if (_wcPath)    {        wcResult = (wchar_t *) MALLOC(sizeof(wchar_t) * _SizeInBytes);        if (wcResult)        {            _wfullpath(wcResult, _wcPath, _SizeInBytes);            wcscpy(_wcFullPath, wcResult);        }    }#else    if (_wcPath)    {        char *_Path = wide_string_to_UTF8(_wcPath);        if (_Path)        {            char *_FullPath = (char *)MALLOC(sizeof(char) * (_SizeInBytes));            if (_FullPath)            {                char *rp = NULL;                rp = realpath(_Path, _FullPath);                if (!rp)                {                    strcpy(_FullPath, _Path);                    normalizePath(_FullPath);                }                wcResult = to_wide_string(_FullPath);                if (wcResult)                {                    wcscpy(_wcFullPath, wcResult);                }                FREE(_FullPath);                _FullPath = NULL;            }            FREE(_Path);            _Path = NULL;        }    }#endif    return wcResult;}
开发者ID:rossdrummond,项目名称:scilab,代码行数:49,


示例8: scirun

static bool scirun(wchar_t *wcommand){	bool bOK = false;	if (wcommand)	{		char *command = wide_string_to_UTF8(wcommand);		if (command)		{			dynlib_scirun(command, strlen(command));			delete command;			command = NULL;			bOK = true;		}	}	return bOK;}
开发者ID:qchartist,项目名称:QChartist,代码行数:16,


示例9: wide_string_to_UTF8

int File::getCountLines(){    char* pstFileName = wide_string_to_UTF8(m_stFilename.c_str());    std::ifstream in(pstFileName);    std::string stLine;    int iLines = 0;    while (std::getline(in, stLine))    {        iLines++;    }    in.close();    FREE(pstFileName);    return iLines;}
开发者ID:scitao,项目名称:scilab,代码行数:16,


示例10: getNamedScalarBoolean

bool getNamedScalarBoolean(const wchar_t* _pstName, bool* _pbool){	int iErr = -1;	if (_pstName)	{		char *varname = wide_string_to_UTF8(_pstName);		if (varname)		{			int bVal = 0;			iErr = dynlib_getNamedScalarBoolean(pvApiCtx, varname, &bVal);			*_pbool = (bVal == TRUE) ? true : false;			delete [] varname;			varname = NULL;		}	}	return (iErr == 0 ? true : false);}
开发者ID:qchartist,项目名称:QChartist,代码行数:17,


示例11: exportLocaleToSystem

/** * Export the variable LC_XXXX to the system * * @param locale the locale (ex : fr_FR or en_US) */BOOL exportLocaleToSystem(const wchar_t *locale){    if (locale == NULL)    {#ifdef _MSC_VER        fprintf(stderr, "Localization: Have not been able to find a suitable locale. Remains to default %s./n", "LC_CTYPE");#else        fprintf(stderr, "Localization: Have not been able to find a suitable locale. Remains to default %ls./n", EXPORTENVLOCALESTR);#endif        return FALSE;    }    /* It will put in the env something like LC_MESSAGES=fr_FR */    if ( !setenvcW(EXPORTENVLOCALESTR, locale))    {#ifdef _MSC_VER        fprintf(stderr, "Localization: Failed to declare the system variable %s./n", "LC_CTYPE");#else        fprintf(stderr, "Localization: Failed to declare the system variable %d./n", EXPORTENVLOCALE);#endif        return FALSE;    }#ifdef _MSC_VER#ifdef USE_SAFE_GETTEXT_DLL    {        /* gettext is buggy on Windows */        /* We need to set a external environment variable to scilab env. */        char* pstr = NULL;        wchar_t env[MAX_PATH];        os_swprintf(env, MAX_PATH, L"%ls=%ls", EXPORTENVLOCALESTR, locale);        pstr = wide_string_to_UTF8(env);        gettext_putenv(pstr);        FREE(pstr);    }#endif#else    /* Export LC_NUMERIC to the system to make sure that the rest of system       is using the english notation (Java, Tcl ...) */    setenvc("LC_NUMERIC", LCNUMERICVALUE);#endif    return TRUE;}
开发者ID:FOSSEE-Internship,项目名称:scilab,代码行数:50,


示例12: to_wide_string

/*--------------------------------------------------------------------------*/char *pathconvert(char* path, BOOL flagtrail, BOOL flagexpand, PathConvertType PType){    char *convertedPath = NULL;    if (path)    {        wchar_t *wcpath = to_wide_string(path);        if (wcpath)        {            wchar_t *wcconvertedPath = pathconvertW(wcpath, flagtrail, flagexpand, PType);            if (wcconvertedPath)            {                convertedPath = wide_string_to_UTF8(wcconvertedPath);                FREE(wcconvertedPath);                wcconvertedPath = NULL;            }        }    }    return convertedPath;}
开发者ID:ZhanlinWang,项目名称:scilab,代码行数:20,


示例13: to_wide_string

static char *getLineAfterCaret(char *wk_buf, unsigned int *cursor, unsigned int *cursor_max){    if (wk_buf)    {        if (*cursor != *cursor_max)        {            int len = *cursor_max - *cursor;            wchar_t * wtmp = to_wide_string(wk_buf);            wchar_t aftercaret[WK_BUF_SIZE];            wcscpy(aftercaret, &wtmp[*cursor]);            aftercaret[len + 1] = '/0';            FREE(wtmp);            return wide_string_to_UTF8(aftercaret);        }    }    return strdup("");}
开发者ID:leowzukw,项目名称:scilab-mirror,代码行数:19,


示例14: to_wide_string

/*--------------------------------------------------------------------------*/char *expandPathVariable(char* str){    char *expanded = NULL;    wchar_t *wstr = to_wide_string(str);    if (wstr)    {        wchar_t *wcexpanded = expandPathVariableW(wstr);        if (wcexpanded)        {            expanded = wide_string_to_UTF8(wcexpanded);            FREE(wcexpanded);            wcexpanded = NULL;        }        FREE(wstr);        wstr = NULL;    }    return expanded;}
开发者ID:FOSSEE-Internship,项目名称:scilab,代码行数:20,


示例15: removedirW

/*--------------------------------------------------------------------------*/ BOOL removedirW(wchar_t *pathW){    if (isdirW(pathW))    {#ifdef _MSC_VER        DeleteDirectory(pathW);#else        char *path = wide_string_to_UTF8(pathW);        if (path)        {            DeleteDirectory(path);            FREE(path);            path = NULL;        }#endif        if (!isdirW(pathW)) return TRUE;    }    return FALSE;}
开发者ID:rossdrummond,项目名称:scilab,代码行数:20,


示例16: sci_hdf5_file_version

types::Function::ReturnValue sci_hdf5_file_version(types::typed_list &in, int _iRetCount, types::typed_list &out){    int rhs = static_cast<int>(in.size());    if (rhs < 1)    {        Scierror(999, _("%s: Wrong number of input argument(s): at least %d expected./n"), fname.data(), 1);        return types::Function::Error;    }    if (in[0]->getId() != types::InternalType::IdScalarString)    {        Scierror(999, _("%s: Wrong size for input argument #%d: string expected./n"), fname.data(), 1);        return types::Function::Error;    }    wchar_t* wfilename = expandPathVariableW(in[0]->getAs<types::String>()->get()[0]);    char* cfilename = wide_string_to_UTF8(wfilename);    std::string filename = cfilename;    FREE(wfilename);    FREE(cfilename);    int iFile = openHDF5File(filename.data(), 0);    if (iFile < 0)    {        Scierror(999, _("%s: Unable to open file: %s/n"), fname.data(), filename.data());        return types::Function::Error;    }    std::wstring wstFuncName;    //manage version information    int version = getSODFormatAttribute(iFile);    closeHDF5File(iFile);    if (version == -1)    {        version = 1;    }    out.push_back(new types::Double(static_cast<double>(version)));    return types::Function::OK;}
开发者ID:FOSSEE-Internship,项目名称:scilab,代码行数:41,


示例17: autoCompletionInConsoleMode

/* Autocompletion in NW/NWNI */void autoCompletionInConsoleMode(wchar_t ** commandLine, unsigned int *cursorLocation){    char *multiByteString = NULL;    wchar_t *wideString = NULL;    int sizeToAlloc = 0;    unsigned int nbrCharInString;    multiByteString = wide_string_to_UTF8(*commandLine);    nbrCharInString = wcslen(*commandLine);    doCompletion(&multiByteString, cursorLocation, &nbrCharInString);    wideString = to_wide_string(multiByteString);    /* Copy the new string in a buffer wich size is a multiple of 1024 */    sizeToAlloc = 1024 * (wcslen(wideString) / 1024 + 1);    FREE(*commandLine);    *commandLine = MALLOC(sizeof(**commandLine) * sizeToAlloc);    wcscpy(*commandLine, wideString);    FREE(wideString);    FREE(multiByteString);}
开发者ID:leowzukw,项目名称:scilab-mirror,代码行数:23,


示例18: sci_notify

/*--------------------------------------------------------------------------*/types::Function::ReturnValue sci_notify(types::typed_list &in, int _iRetCount, types::typed_list &out){    types::String* pString  = NULL;    wchar_t* wcsInput       = NULL;    if (in.size() != 1)    {        Scierror(999, _("%s: Wrong number of input arguments: %d expected./n"), "notify" , 1);        return types::Function::Error;    }    if (in[0]->isString() == false)    {        Scierror(999, _("%s: Wrong type for input argument #%d: string expected./n"), "notify", 1);        return types::Function::Error;    }    pString = in[0]->getAs<types::String>();    if (pString->isScalar() == FALSE)    {        Scierror(999, _("%s: Wrong size for input argument #%d: string expected./n"), "notify" , 1);        return types::Function::Error;    }    wcsInput = pString->get(0);    char* strInput = wide_string_to_UTF8(wcsInput);    try    {        org_scilab_modules_action_binding_utils::Signal::notify(getScilabJavaVM(), strInput);    }    catch (const GiwsException::JniException & e)    {        Scierror(999, _("%s: A Java exception arisen:/n%s"), "notify", e.whatStr().c_str());        FREE(strInput);        return types::Function::Error;    }    FREE(strInput);    return types::Function::OK;}
开发者ID:leowzukw,项目名称:scilab-mirror,代码行数:40,


示例19: to_wide_string

/*--------------------------------------------------------------------------*/ char *FindFileAssociation (char *ptrFindStr,char *Extra) {	char *ptrResult = NULL ;	if ( ptrFindStr )	{		wchar_t *wcptrFindStr = to_wide_string(ptrFindStr);		wchar_t *wcExtra = to_wide_string(Extra);		wchar_t szDefault[PATH_MAX + FILENAME_MAX];		DWORD ccDefault = PATH_MAX + FILENAME_MAX;		if (wcptrFindStr)		{			HRESULT rc = AssocQueryStringW (0, ASSOCSTR_EXECUTABLE,wcptrFindStr, wcExtra, szDefault, &ccDefault);			if (ccDefault)			{				if (rc == S_OK) ptrResult = wide_string_to_UTF8(szDefault);			}		}	}	return ptrResult;}
开发者ID:rossdrummond,项目名称:scilab,代码行数:23,


示例20: isdirW

/*--------------------------------------------------------------------------*/BOOL isdirW(const wchar_t * wcpath){    BOOL bOK = FALSE;#ifndef _MSC_VER    struct stat buf;    char *path = wide_string_to_UTF8(wcpath);    if (path == NULL)    {        return FALSE;    }    bOK = isdir(path);    FREE(path);#else    if (isDriveW(wcpath))    {        return TRUE;    }    else    {        DWORD attr = 0;        wchar_t *tmpPath = os_wcsdup(wcpath);        if ( (tmpPath[wcslen(tmpPath) - 1] == L'//') || (tmpPath[wcslen(tmpPath) - 1] == L'/') )        {            tmpPath[wcslen(tmpPath) - 1] = L'/0';        }        attr = GetFileAttributesW(tmpPath);        FREE(tmpPath);        if (attr == INVALID_FILE_ATTRIBUTES)        {            return FALSE;        }        return ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) ? TRUE : FALSE;    }#endif    return bOK;}
开发者ID:leowzukw,项目名称:scilab-mirror,代码行数:38,


示例21: getTMPDIRW

/*--------------------------------------------------------------------------*/wchar_t *createtempfilenameW(const wchar_t *wcprefix, BOOL bShortFormat){    wchar_t *wcReturnedTempFilename = NULL;#ifdef _MSC_VER    wchar_t *wcTmpDir = getTMPDIRW();    if (wcTmpDir)    {        unsigned int uRetVal = 0;        wchar_t wcTempFileName[MAX_PATH];        uRetVal = GetTempFileNameW(wcTmpDir, wcprefix, 0, wcTempFileName);        if (uRetVal != 0)        {            size_t len = wcslen(wcTempFileName) + 1;            wchar_t* shortTempFilename = (wchar_t *)MALLOC(len * sizeof(wchar_t));            if (shortTempFilename)            {                if (bShortFormat)                {                    GetShortPathNameW(wcTempFileName, shortTempFilename, (DWORD)len);                }                wcReturnedTempFilename = shortTempFilename;            }        }    }#else    char *prefix = wide_string_to_UTF8(wcprefix);    char *result = createtempfilename(prefix, bShortFormat);    wcReturnedTempFilename = to_wide_string(result);    if (result) {FREE(result); result = NULL;}    if (prefix) {FREE(prefix); prefix = NULL;}    if (result) {FREE(result); result = NULL;}#endif    return wcReturnedTempFilename;}
开发者ID:rossdrummond,项目名称:scilab,代码行数:38,


示例22: wide_string_to_UTF8

bool PCREMatcher::match(const wchar_t * str, const unsigned int len, const bool full) const{    if (!pattern.empty())    {        int resVect[3];        char * _str = wide_string_to_UTF8(str);        int result = pcre_exec(re, nullptr, _str, len, 0, 0, resVect, sizeof(resVect) / sizeof(int));        FREE(_str);        if (full)        {            if (result == 1 && resVect[0] == 0 && resVect[1] == len)            {                return true;            }        }        else        {            return result == 1;        }        return false;    }    return true;}
开发者ID:leowzukw,项目名称:scilab-mirror,代码行数:24,


示例23: to_wide_string

/*--------------------------------------------------------------------------*/char *createtempfilename(const char *prefix, BOOL bShortFormat){    char *tempfilename = NULL;#ifdef _MSC_VER    wchar_t *wcprefix = to_wide_string(prefix);    wchar_t *wcresult = createtempfilenameW(wcprefix, bShortFormat);    tempfilename = wide_string_to_UTF8(wcresult);    if (wcresult) {FREE(wcresult); wcresult = NULL;}    if (wcresult) {FREE(wcresult); wcresult = NULL;}#else     char *TmpDir = getTMPDIR();     if (TmpDir)     {        char TempFileName[PATH_MAX];        sprintf(TempFileName, "%s/%sXXXXXX",TmpDir, prefix);        int fd = mkstemp(TempFileName);        if (fd != -1) close(fd);        tempfilename = strdup(TempFileName);     }#endif    return tempfilename;}
开发者ID:rossdrummond,项目名称:scilab,代码行数:25,


示例24: sci_interp3d

//.........这里部分代码省略.........    pDblZ = pTList->getField(L"tz")->getAs<types::Double>();    pDblOrder = pTList->getField(L"order")->getAs<types::Double>();    pDblCoef = pTList->getField(L"bcoef")->getAs<types::Double>();    pDblXyzminmax = pTList->getField(L"xyzminmax")->getAs<types::Double>();    if (in.size() == 5)    {        if (in[4]->isString() == false)        {            Scierror(999, _("%s: Wrong type for input argument #%d : string expected./n"), "interp3d", 5);            return types::Function::Error;        }        wchar_t* wcsType = in[4]->getAs<types::String>()->get(0);        if (wcscmp(wcsType, L"C0") == 0)        {            iType = 8;        }        else if (wcscmp(wcsType, L"by_zero") == 0)        {            iType = 7;        }        else if (wcscmp(wcsType, L"periodic") == 0)        {            iType = 3;        }        else if (wcscmp(wcsType, L"by_nan") == 0)        {            iType = 10;        }        else // undefined        {            char* pstType = wide_string_to_UTF8(wcsType);            Scierror(999, _("%s: Wrong values for input argument #%d : '%s' is an unknown '%s' type./n"), "interp3d", 5, pstType, "outmode");            FREE(pstType);            return types::Function::Error;        }    }    else    {        //"C0"        iType = 8;    }    // *** Perform operation. ***    pDblFp = new types::Double(pDblXYZ[0]->getRows(), pDblXYZ[0]->getCols());    order[0] = static_cast<int>(pDblOrder->get(0));    order[1] = static_cast<int>(pDblOrder->get(1));    order[2] = static_cast<int>(pDblOrder->get(2));    int sizeOfX = pDblX->getRows() - order[0];    int sizeOfY = pDblY->getRows() - order[1];    int sizeOfZ = pDblZ->getRows() - order[2];    double* minmax = pDblXyzminmax->get();    int workSize = order[1] * order[2] + 3 * std::max(order[0], std::max(order[1], order[2])) + order[2];    double* work = new double[workSize];    if (_iRetCount == 1)    {        C2F(driverdb3val)(pDblXYZ[0]->get(), pDblXYZ[1]->get(), pDblXYZ[2]->get(), pDblFp->get(), &sizeOfXp,                          pDblX->get(), pDblY->get(), pDblZ->get(), &sizeOfX, &sizeOfY, &sizeOfZ,                          &order[0], &order[1], &order[2], pDblCoef->get(), work,
开发者ID:leowzukw,项目名称:scilab-mirror,代码行数:67,


示例25: sci_intg

//.........这里部分代码省略.........    if (ISNAN(pdB) || C2F(vfinite)(&iOne , &pdB) == false)    {        Scierror(264, _("%s: Wrong type for input argument #%d: Must not contain NaN or Inf./n"), "intg", 1);        return types::Function::Error;    }    // function    DifferentialEquationFunctions deFunctionsManager(L"intg");    DifferentialEquation::addDifferentialEquationFunctions(&deFunctionsManager);    if (in[2]->isCallable())    {        types::Callable* pCall = in[2]->getAs<types::Callable>();        deFunctionsManager.setFFunction(pCall);        // check function        double t = 1;        double ret = intg_f(&t);        /* if (ret == 0)        {            Scierror(50, _("%s: Argument #%d: Variable returned by scilab argument function is incorrect./n"), "intg", 3);            DifferentialEquation::removeDifferentialEquationFunctions();            return types::Function::Error;        }*/    }    else if (in[2]->isString())    {        bool bOK = false;        types::String* pStr = in[2]->getAs<types::String>();        bOK = deFunctionsManager.setFFunction(pStr);        if (bOK == false)        {            char* pst = wide_string_to_UTF8(pStr->get(0));            Scierror(50, _("%s: Subroutine not found: %s/n"), "intg", pst);            FREE(pst);            DifferentialEquation::removeDifferentialEquationFunctions();            return types::Function::Error;        }    }    else if (in[2]->isList())    {        types::List* pList = in[2]->getAs<types::List>();        if (pList->getSize() == 0)        {            Scierror(50, _("%s: Argument #%d: Subroutine not found in list: %s/n"), "intg", 3, "(string empty)");            DifferentialEquation::removeDifferentialEquationFunctions();            return types::Function::Error;        }        if (pList->get(0)->isCallable())        {            deFunctionsManager.setFFunction(pList->get(0)->getAs<types::Callable>());            for (int iter = 1; iter < pList->getSize(); iter++)            {                deFunctionsManager.setFArgs(pList->get(iter)->getAs<types::InternalType>());            }        }        else        {            Scierror(999, _("%s: Wrong type for input argument #%d: The first argument in the list must be a Scilab function./n"), "intg", 3);            DifferentialEquation::removeDifferentialEquationFunctions();            return types::Function::Error;        }    }
开发者ID:opencollab,项目名称:scilab,代码行数:67,


示例26: sci_feval

/*--------------------------------------------------------------------------*/types::Function::ReturnValue sci_feval(types::typed_list &in, int _iRetCount, types::typed_list &out){    int iPos = 0;    int nn   = 1;    int iErr = 0;    //input    types::Double* pDblX = NULL;    types::Double* pDblY = NULL;    // output    types::Double* pDblOut = NULL;    // error message catched    std::wostringstream os;    bool bCatch = false;    // *** check the minimal number of input args. ***    if (in.size() < 2 || in.size() > 3)    {        Scierror(77, _("%s: Wrong number of input argument(s): %d to %d expected./n"), "feval", 2, 3);        return types::Function::Error;    }    // *** check number of output args according the methode. ***    if (_iRetCount > 1)    {        Scierror(78, _("%s: Wrong number of output argument(s): %d expected./n"), "feval", 1);        return types::Function::Error;    }    // *** check type of input args and get it. ***    // X    if (in[iPos]->isDouble() == false)    {        Scierror(999, _("%s: Wrong type for input argument #%d : A real matrix expected./n"), "feval", iPos + 1);        return types::Function::Error;    }    pDblX = in[iPos]->getAs<types::Double>();    if (pDblX->isComplex())    {        Scierror(999, _("%s: Wrong type for input argument #%d : A real matrix expected./n"), "feval", iPos + 1);        return types::Function::Error;    }    iPos++;    // Y    if (in.size() == 3)    {        if (in[iPos]->isDouble() == false)        {            Scierror(999, _("%s: Wrong type for input argument #%d : A real matrix expected./n"), "feval", iPos + 1);            return types::Function::Error;        }        pDblY = in[iPos]->getAs<types::Double>();        if (pDblY->isComplex())        {            Scierror(999, _("%s: Wrong type for input argument #%d : A real matrix expected./n"), "feval", iPos + 1);            return types::Function::Error;        }        iPos++;        nn = 2;    }    // function    DifferentialEquationFunctions deFunctionsManager(L"feval");    DifferentialEquation::addDifferentialEquationFunctions(&deFunctionsManager);    if (in[iPos]->isCallable())    {        types::Callable* pCall = in[iPos]->getAs<types::Callable>();        deFunctionsManager.setFFunction(pCall);    }    else if (in[iPos]->isString())    {        bool bOK = false;        types::String* pStr = in[iPos]->getAs<types::String>();        bOK = deFunctionsManager.setFFunction(pStr);        if (bOK == false)        {            char* pst = wide_string_to_UTF8(pStr->get(0));            Scierror(50, _("%s: Subroutine not found: %s/n"), "feval", pst);            FREE(pst);            DifferentialEquation::removeDifferentialEquationFunctions();            return types::Function::Error;        }    }    else if (in[iPos]->isList())    {        types::List* pList = in[iPos]->getAs<types::List>();        if (pList->getSize() == 0)        {            Scierror(50, _("%s: Argument #%d : Subroutine not found in list: %s/n"), "feval", iPos + 1, "(string empty)");            DifferentialEquation::removeDifferentialEquationFunctions();            return types::Function::Error;        }//.........这里部分代码省略.........
开发者ID:FOSSEE-Internship,项目名称:scilab,代码行数:101,



注:本文中的wide_string_to_UTF8函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ widen函数代码示例
C++ wiced_assert函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。