当前位置: 首页>>代码示例>>C++>>正文


C++ DatabasePtr::getDatabaseCharset方法代码示例

本文整理汇总了C++中DatabasePtr::getDatabaseCharset方法的典型用法代码示例。如果您正苦于以下问题:C++ DatabasePtr::getDatabaseCharset方法的具体用法?C++ DatabasePtr::getDatabaseCharset怎么用?C++ DatabasePtr::getDatabaseCharset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabasePtr的用法示例。


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

示例1: loadProperties

void Function::loadProperties()
{
    setPropertiesLoaded(false);

    wxString mechanismNames[] = { "value", "reference",
        "descriptor", "blob descriptor", "scalar array",
        "null", wxEmptyString };
    wxString mechanismDDL[] = { " BY VALUE ", wxEmptyString,
        " BY DESCRIPTOR ", wxEmptyString, " BY SCALAR ARRAY ",
        " NULL ", wxEmptyString };

    bool first = true;
    wxString retstr;
    definitionM = getName_() + "(" + wxTextBuffer::GetEOL();
    paramListM = wxEmptyString;

    DatabasePtr db = getDatabase();
    MetadataLoader* loader = db->getMetadataLoader();
    wxMBConv* converter = db->getCharsetConverter();
    MetadataLoaderTransaction tr(loader);

    IBPP::Statement& st1 = loader->getStatement(
        "SELECT f.RDB$RETURN_ARGUMENT, a.RDB$MECHANISM,"
        " a.RDB$ARGUMENT_POSITION, a.RDB$FIELD_TYPE, a.RDB$FIELD_SCALE,"
        " a.RDB$FIELD_LENGTH, a.RDB$FIELD_SUB_TYPE, a.RDB$FIELD_PRECISION,"
        " f.RDB$MODULE_NAME, f.RDB$ENTRYPOINT, c.RDB$CHARACTER_SET_NAME "
        " FROM RDB$FUNCTIONS f"
        " LEFT OUTER JOIN RDB$FUNCTION_ARGUMENTS a"
        " ON f.RDB$FUNCTION_NAME = a.RDB$FUNCTION_NAME"
        " LEFT OUTER JOIN RDB$CHARACTER_SETS c"
        " ON a.RDB$CHARACTER_SET_ID = c.RDB$CHARACTER_SET_ID"
        " WHERE f.RDB$FUNCTION_NAME = ? "
        " ORDER BY a.RDB$ARGUMENT_POSITION"
    );
    st1->Set(1, wx2std(getName_(), converter));
    st1->Execute();
    while (st1->Fetch())
    {
        short returnarg, mechanism, type, scale, length, subtype, precision,
            retpos;
        std::string libraryName, entryPoint, charset;
        st1->Get(1, returnarg);
        st1->Get(2, mechanism);
        st1->Get(3, retpos);
        st1->Get(4, type);
        st1->Get(5, scale);
        st1->Get(6, length);
        st1->Get(7, subtype);
        st1->Get(8, precision);
        st1->Get(9, libraryName);
        libraryNameM = wxString(libraryName.c_str(), *converter).Strip();
        st1->Get(10, entryPoint);
        entryPointM = wxString(entryPoint.c_str(), *converter).Strip();
        wxString datatype = Domain::dataTypeToString(type, scale,
            precision, subtype, length);
        if (!st1->IsNull(11))
        {
            st1->Get(11, charset);
            wxString chset = wxString(charset.c_str(), *converter).Strip();
            if (db->getDatabaseCharset() != chset)
            {
                datatype += " " + SqlTokenizer::getKeyword(kwCHARACTER)
                    + " " + SqlTokenizer::getKeyword(kwSET)
                    + " " + chset;
            }
        }
        if (type == 261)    // avoid subtype information for BLOB
            datatype = SqlTokenizer::getKeyword(kwBLOB);

        int mechIndex = (mechanism < 0 ? -mechanism : mechanism);
        if (mechIndex >= (sizeof(mechanismNames)/sizeof(wxString)))
            mechIndex = (sizeof(mechanismNames)/sizeof(wxString)) - 1;
        wxString param = "    " + datatype + " "
            + SqlTokenizer::getKeyword(kwBY) + " "
            + mechanismNames[mechIndex];
        if (mechanism < 0)
            param += wxString(" ") + SqlTokenizer::getKeyword(kwFREE_IT);
        if (returnarg == retpos)    // output
        {
            retstr = param;
            retstrM = datatype + mechanismDDL[mechIndex];
            if (retpos != 0)
            {
                retstrM = SqlTokenizer::getKeyword(kwPARAMETER) + " ";
                retstrM << retpos;
                if (!paramListM.IsEmpty())
                    paramListM += ", ";
                paramListM += datatype + mechanismDDL[mechIndex];
            }
        }
        else
        {
            if (first)
                first = false;
            else
                definitionM += wxString(",") + wxTextBuffer::GetEOL();
            definitionM += param;
            if (!paramListM.empty())
                paramListM += ", ";
            paramListM += datatype + mechanismDDL[mechIndex];
//.........这里部分代码省略.........
开发者ID:AlfiyaZi,项目名称:flamerobin,代码行数:101,代码来源:function.cpp


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