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


C++ OovString::setUpperCase方法代码示例

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


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

示例1: makeDefineName

void CMaker::makeDefineName(OovStringRef const pkgName, OovString &defName)
    {
    OovString shortName;
    for(const char *p = pkgName; *p!='\0'; p++)
        {
        if(isalpha(*p))
            shortName += *p;
        }
    defName.setUpperCase(shortName);
    }
开发者ID:8l,项目名称:oovcde,代码行数:10,代码来源:oovCMaker.cpp

示例2: makeTopInFile

void CMaker::makeTopInFile(OovStringRef const destName)
    {
    OovString projNameUpper;
    projNameUpper.setUpperCase(mProjectName);
    OovStringVec const compNames = mCompTypes.getComponentNames(true);

    std::string str = std::string("# - Config file for the ") + mProjectName + " package\n";

    str += "# Compute paths\n";
    str += std::string("get_filename_component(") + projNameUpper +
            "_CMAKE_DIR \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n";
    str += std::string("set(") + projNameUpper + "_INCLUDE_DIRS \"@[email protected]\")\n\n";

    str += "# Our library dependencies (contains definitions for IMPORTED targets)\n";
    str += std::string("if(NOT TARGET ") + mProjectName + "AND NOT " +
            projNameUpper + "_BINARY_DIR)\n";
    str += "   include(\"${FOOBAR_CMAKE_DIR}/" + mProjectName + "Targets.cmake\")\n";
    str += "endif()\n\n";

    str += std::string("# These are IMPORTED targets created by ") + mProjectName +
            "Targets.cmake\n";
    str += std::string("set(") + projNameUpper + "_LIBRARIES";
    for(auto const &name : compNames)
        {
        ComponentTypesFile::eCompTypes compType = mCompTypes.getComponentType(name);
        if(compType == ComponentTypesFile::CT_StaticLib)
            {
            str += ' ';
            str += name;
            }
        }
    str += ")\n";
    str += std::string("set(") + projNameUpper + "_EXECUTABLE";
    for(auto const &name : compNames)
        {
        ComponentTypesFile::eCompTypes compType = mCompTypes.getComponentType(name);
        if(compType == ComponentTypesFile::CT_Program)
            {
            str += ' ';
            str += name;
            }
        }
    str += ")\n";
    writeFile(destName, str);
    }
开发者ID:8l,项目名称:oovcde,代码行数:45,代码来源:oovCMaker.cpp

示例3: makeTopVerInFile

void CMaker::makeTopVerInFile(OovStringRef const destName)
    {
    OovString projNameUpper;
    projNameUpper.setUpperCase(mProjectName);

    std::string str;
    str += "set(PACKAGE_VERSION \"@" + projNameUpper + "[email protected]\")\n\n";

    str += "# Check whether the requested PACKAGE_FIND_VERSION is compatible\n";
    str += "if(\"${PACKAGE_VERSION}\" VERSION_LESS \"${PACKAGE_FIND_VERSION}\")\n";
    str += "   set(PACKAGE_VERSION_COMPATIBLE FALSE)\n";
    str += "else()\n";
    str += "   set(PACKAGE_VERSION_COMPATIBLE TRUE)\n";
    str += "   if (\"${PACKAGE_VERSION}\" VERSION_EQUAL \"${PACKAGE_FIND_VERSION}\")\n";
    str += "      set(PACKAGE_VERSION_EXACT TRUE)\n";
    str += "   endif()\n";
    str += "endif()\n";
    writeFile(destName, str);
    }
开发者ID:8l,项目名称:oovcde,代码行数:19,代码来源:oovCMaker.cpp

示例4: makeTopMakelistsFile

void CMaker::makeTopMakelistsFile(OovStringRef const destName)
    {
    std::string str;

    str += "cmake_minimum_required(VERSION 2.8)\n";
    str += std::string("project(") + mProjectName + ")\n";
    str += "INCLUDE(FindPkgConfig)\n\n";

    OovString projNameUpper;
    projNameUpper.setUpperCase(mProjectName);
    str += std::string("set(") + projNameUpper + "_MAJOR_VERION 0)\n";
    str += std::string("set(") + projNameUpper + "_MINOR_VERION 1)\n";
    str += std::string("set(") + projNameUpper + "_PATCH_VERION 0)\n";
    str += std::string("set(") + projNameUpper + "_VERION\n";
    str += std::string("${") + projNameUpper + "_MAJOR_VERSION}.${";
    str += projNameUpper + "_MINOR_VERSION}.${";
    str += projNameUpper + "_PATCH_VERSION})\n\n";

    str += "# Offer the user the choice of overriding the installation directories\n";
    str += "set(INSTALL_LIB_DIR lib CACHE PATH \"Installation directory for libraries\")\n";
    str += "set(INSTALL_BIN_DIR bin CACHE PATH \"Installation directory for executables\")\n";
    str += "set(INSTALL_INCLUDE_DIR include CACHE PATH\n";
    str += "   \"Installation directory for header files\")\n";
    str += "if(WIN32 AND NOT CYGWIN)\n";
    str += "   set(DEF_INSTALL_CMAKE_DIR CMake)\n";
    str += "else()\n";
    str += std::string("   set(DEF_INSTALL_CMAKE_DIR lib/CMake/") + mProjectName + ")\n";
    str += "endif()\n";
    str += "set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH\n";
    str += "   \"Installation directory for CMake files\")\n\n";

    str += "# Make relative paths absolute (needed later on)\n";
    str += "foreach(p LIB BIN INCLUDE CMAKE)\n";
    str += "   set(var INSTALL_${p}_DIR)\n";
    str += "   if(NOT IS_ABSOLUTE \"${${var}}\")\n";
    str += "      set(${var} \"${CMAKE_INSTALL_PREFIX}/${${var}}\")\n";
    str += "   endif()\n";
    str += "endforeach()\n\n";

    str += "# Add debug and release flags\n";
    str += "# Use from the command line with -DCMAKE_BUILD_TYPE=Release or Debug\n";
    str += "set(CMAKE_CXX_FLAGS_DEBUG \"${CMAKE_CXX_FLAGS_DEBUG} -Wall\")\n";
    str += "set(CMAKE_CXX_FLAGS_RELEASE \"${CMAKE_CXX_FLAGS_RELEASE} -Wall\")\n";

    str += "# External Packages\n";
    str += "if(NOT WIN32)\n";
    for(auto const &pkg : mBuildPkgs.getPackages())
        {
        addPackageDefines(pkg.getPkgName(), str);
        }
    str += "endif()\n\n";

    str += "# set up include directories\n";
    str += "include_directories(\n";

    OovStringVec const compNames = mCompTypes.getComponentNames(true);
    for(auto const &name : compNames)
        {
        ComponentTypesFile::eCompTypes compType = mCompTypes.getComponentType(name);
        if(compType == ComponentTypesFile::CT_StaticLib)
            str += std::string("   \"${PROJECT_SOURCE_DIR}/") + name + "\"\n";
        }
    str += "   )\n";
    str += "add_definitions(-std=c++11)\n\n";

    str += "# Add sub directories\n";
    for(auto const &name : compNames)
        {
        ComponentTypesFile::eCompTypes compType = mCompTypes.getComponentType(name);
        if(compType != ComponentTypesFile::CT_Unknown)
            {
            std::string compRelDir = name;
            str += std::string("add_subdirectory(") + compRelDir + ")\n";
            }
        }

    str += "# Add all targets to the build-tree export set\n";
    str += "export(TARGETS ";
    for(auto const &name : compNames)
        {
        ComponentTypesFile::eCompTypes compType = mCompTypes.getComponentType(name);
        if(compType != ComponentTypesFile::CT_Unknown)
            {
            str += ' ';
            str += makeComponentNameFromDir(name);
            }
        }
    str += "\n";
    str += "   FILE \"${PROJECT_BINARY_DIR}/" + mProjectName + "Targets.cmake\")\n\n";

    str += "# Export the package for use from the build-tree\n";
    str += "# (this registers the build-tree with a global CMake-registry)\n";
    str += std::string("export(PACKAGE ") + mProjectName + ")\n\n";

    str += std::string("# Create the ") +  mProjectName + "Config.cmake and " +
            mProjectName + "ConfigVersion files\n";
    str += "file(RELATIVE_PATH REL_INCLUDE_DIR \"${INSTALL_CMAKE_DIR}\"\n";
    str += "   \"${INSTALL_INCLUDE_DIR}\")\n";
    str += "# for the build tree\n";
    str += "set(CONF_INCLUDE_DIRS \"${PROJECT_SOURCE_DIR}\" \"${PROJECT_BINARY_DIR}\")\n";
//.........这里部分代码省略.........
开发者ID:8l,项目名称:oovcde,代码行数:101,代码来源:oovCMaker.cpp


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