本文整理汇总了C++中Klass::genCppNameSpaceInclusionPath方法的典型用法代码示例。如果您正苦于以下问题:C++ Klass::genCppNameSpaceInclusionPath方法的具体用法?C++ Klass::genCppNameSpaceInclusionPath怎么用?C++ Klass::genCppNameSpaceInclusionPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Klass
的用法示例。
在下文中一共展示了Klass::genCppNameSpaceInclusionPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateRdfTypeInfo
void generateRdfTypeInfo(const ontology::Ontology& ontology) {
std::ofstream oifs;
createFile(RdfsEntity::outdir + "/RdfTypeInfo.h", &oifs);
startInternal(oifs);
generateCodeProtectorBegin(oifs, "", "RdfTypeInfo");
oifs << "class RdfTypeInfo {" << std::endl;
oifs << "public:" << std::endl;
indent(oifs, 1) << "RdfTypeInfo();" << std::endl;
oifs << std::endl;
indent(oifs, 1) << "static const std::map<std::string, std::set<std::string> >& data() { return DATA; }" << std::endl;
oifs << "private:" << std::endl;
indent(oifs, 1) << "static std::map<std::string, std::set<std::string> > DATA;" << std::endl;
oifs << "};" << std::endl;
oifs << std::endl;
generateCodeProtectorEnd(oifs, "", "RdfTypeInfo");
stopInternal(oifs);
std::ofstream ofs;
createFile(RdfsEntity::outdir + "/RdfTypeInfo.cpp", &ofs);
startInternal(ofs);
addBoilerPlate(ofs);
ofs << std::endl;
ofs << "#include <map>" << std::endl;
ofs << "#include <set>" << std::endl;
ofs << "#include <string>" << std::endl;
ofs << std::endl;
if ( RdfsEntity::outdir == ".") {
ofs << "#include \"RdfTypeInfo.h\"" << std::endl;
} else {
ofs << "#include \"" << RdfsEntity::outdir << "/RdfTypeInfo.h\"" << std::endl;
}
ofs << std::endl;
for ( auto const& klassMapItem: ontology.classUri2Ptr()) {
const Klass cls(*klassMapItem.second);
ofs << "#include \"" << cls.genCppNameSpaceInclusionPath() << "/" << klassMapItem.second->prettyIRIName() << ".h" << "\"" << std::endl;
}
ofs << std::endl;
ofs << "std::map<std::string, std::set<std::string> > RdfTypeInfo::DATA;" << std::endl;
ofs << std::endl;
ofs << "RdfTypeInfo::RdfTypeInfo() {" << std::endl;
indent(ofs, 1) << "if ( DATA.empty() ) {" << std::endl;
for ( auto const& klassMapItem: ontology.classUri2Ptr()) {
const Klass& cls = *klassMapItem.second;
indent(ofs, 2) << "DATA[\"" << klassMapItem.first << "\"] = " << cls.genCppNameSpaceFullyQualified() << "::" <<
klassMapItem.second->prettyIRIName() << "::ancestorsRdfTypeIRI();" << std::endl;
}
indent(ofs, 1) << "};" << std::endl;
ofs << std::endl;
ofs << "}" << std::endl;
ofs << std::endl;
ofs << "namespace {" << std::endl;
ofs << "RdfTypeInfo __loader;" << std::endl;
ofs << "}" << std::endl;
stopInternal(ofs);
}