本文整理汇总了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"));
}
示例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/"))));
}
示例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());
}
示例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);
}
}
示例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")));
}