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


C++ openstudio::toString方法代码示例

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


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

示例1: resourcesPath

TEST_F(CoreFixture, Path_SetFileExtension)
{
  // example usage for assigning proper file extension
  path p = resourcesPath()/toPath("energyplus/5ZoneAirCooled/in");
  path result = setFileExtension(p,"idf");
  EXPECT_TRUE(boost::filesystem::extension(p).empty());
  EXPECT_TRUE(toString(boost::filesystem::extension(result)) == std::string(".idf"));
  EXPECT_TRUE(boost::filesystem::exists(result));
  EXPECT_TRUE(boost::filesystem::is_regular_file(result));

  // passes out path as is if file extension already set
  p = resourcesPath()/toPath("energyplus/5ZoneAirCooled/in.idf");
  result = setFileExtension(p,"idf");
  EXPECT_TRUE(toString(boost::filesystem::extension(p)) == std::string(".idf"));
  EXPECT_TRUE(toString(boost::filesystem::extension(result)) == std::string(".idf"));

  // will not replace extension, but will log warning and alert user by returning empty path
  p = toPath("energyplus/5ZoneAirCooled/in.osm");
  result = setFileExtension(p,"idf",false);
  EXPECT_TRUE(result == p);

  // will replace extension if asked
  p = toPath("energyplus/5ZoneAirCooled/in.osm");
  result = setFileExtension(p,"idf",true,false);
  EXPECT_TRUE(toString(boost::filesystem::extension(result)) == std::string(".idf"));

  // setFileExtension does not care about existence
  p = toPath("fakeDir/fakeDirOrFile");
  result = setFileExtension(p,"jjj",true);
  EXPECT_TRUE(toString(boost::filesystem::extension(result)) == std::string(".jjj"));
}
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:31,代码来源:Path_GTest.cpp

示例2: toPath

TEST_F(CoreFixture, Path_RelativePathToFile) 
{
  path relPath = toPath("energyplus/5ZoneAirCooled/eplusout.sql");
  path fullPath = resourcesPath() / relPath;
  EXPECT_EQ(toString(relPath),toString(relativePath(fullPath,resourcesPath())));

  EXPECT_EQ("eplusout.sql",toString(relativePath(relPath,toPath("energyplus/5ZoneAirCooled/"))));
}
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:8,代码来源:Path_GTest.cpp

示例3: resourcesPath

TEST(EEFG, DummyTest)
{
  openstudio::path iddPath = resourcesPath()/toPath("eefg/dummy.idd");

  openstudio::path idfPath = resourcesPath()/toPath("eefg/dummy.idf");
  openstudio::path outPath = resourcesPath()/toPath("eefg/eefg.idf");
  eefgValidateIdf(toString(iddPath).c_str(), toString(idfPath).c_str(), toString(outPath).c_str());
}
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:8,代码来源:Eefg_GTest.cpp

示例4:

TEST(Checksum, UUIDs) {
  StringVector checksums;
  for (unsigned i = 0, n = 1000; i < n; ++i) {
    checksums.push_back(checksum(toString(createUUID())));
  }
  auto itStart = checksums.begin();
  ++itStart;
  for (auto it = checksums.begin(), itEnd = checksums.end(); 
       itStart != itEnd; ++it, ++itStart) {
    EXPECT_TRUE(std::find(itStart,itEnd,*it) == itEnd);
  }
}
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:12,代码来源:Checksum_GTest.cpp

示例5: toString

TEST_F(CoreFixture, Path_toString) 
{
  EXPECT_EQ("energyplus/5ZoneAirCooled/eplusout.sql", toString(toPath("energyplus/5ZoneAirCooled/eplusout.sql")));
  EXPECT_EQ("energyplus/5ZoneAirCooled/eplusout.sql", toString(toPath("energyplus\\5ZoneAirCooled\\eplusout.sql")));
  EXPECT_EQ("/energyplus/5ZoneAirCooled/eplusout.sql", toString(toPath("/energyplus/5ZoneAirCooled/eplusout.sql")));
  EXPECT_EQ("/energyplus/5ZoneAirCooled/eplusout.sql", toString(toPath("/energyplus\\5ZoneAirCooled\\eplusout.sql")));
  EXPECT_EQ("energyplus/5ZoneAirCooled/", toString(toPath("energyplus/5ZoneAirCooled/")));
  EXPECT_EQ("energyplus/5ZoneAirCooled/", toString(toPath("energyplus\\5ZoneAirCooled\\")));
  EXPECT_EQ("/energyplus/5ZoneAirCooled/", toString(toPath("/energyplus/5ZoneAirCooled/")));
  EXPECT_EQ("/energyplus/5ZoneAirCooled/", toString(toPath("\\energyplus\\5ZoneAirCooled\\")));
  EXPECT_EQ("energyplus/5ZoneAirCooled", toString(toPath("energyplus/5ZoneAirCooled")));
  EXPECT_EQ("energyplus/5ZoneAirCooled", toString(toPath("energyplus\\5ZoneAirCooled")));
  EXPECT_EQ("/energyplus/5ZoneAirCooled", toString(toPath("/energyplus/5ZoneAirCooled")));
  EXPECT_EQ("/energyplus/5ZoneAirCooled", toString(toPath("\\energyplus\\5ZoneAirCooled")));
}
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:15,代码来源:Path_GTest.cpp


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