本文整理汇总了C++中ContainedPtr::scope方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainedPtr::scope方法的具体用法?C++ ContainedPtr::scope怎么用?C++ ContainedPtr::scope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainedPtr
的用法示例。
在下文中一共展示了ContainedPtr::scope方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scopedToName
void
CodeVisitor::startNamespace(const ContainedPtr& cont)
{
if(_ns)
{
string scope = cont->scope();
scope = scope.substr(2); // Removing leading '::'
scope = scope.substr(0, scope.length() - 2); // Removing trailing '::'
_out << sp << nl << "namespace " << scopedToName(scope, true);
_out << sb;
}
}
示例2: fixIdent
string
Slice::Ruby::getAbsolute(const ContainedPtr& cont, IdentStyle style, const string& prefix)
{
string scope = fixIdent(cont->scope(), IdentToUpper);
if(prefix.empty())
{
return scope + fixIdent(cont->name(), style);
}
else
{
return scope + prefix + fixIdent(cont->name(), style);
}
}
示例3: scopedToName
string
Slice::PHP::getAbsolute(const ContainedPtr& cont, bool ns, const string& prefix, const string& suffix)
{
return scopedToName(cont->scope() + prefix + cont->name() + suffix, ns);
}
示例4: if
string
Slice::JsGenerator::typeToString(const TypePtr& type,
const ContainedPtr& toplevel,
const vector<pair<string, string> >& imports,
bool typescript,
bool definition)
{
if(!type)
{
return "void";
}
bool local = false;
if(toplevel)
{
if(ConstructedPtr::dynamicCast(toplevel))
{
local = ConstructedPtr::dynamicCast(toplevel)->isLocal();
}
else if(ClassDefPtr::dynamicCast(toplevel))
{
local = ClassDefPtr::dynamicCast(toplevel)->isLocal();
}
}
static const char* typeScriptBuiltinTable[] =
{
"number", // byte
"boolean", // bool
"number", // short
"number", // int
"Ice.Long", // long
"number", // float
"number", // double
"string",
"Ice.Object",
"Ice.ObjectPrx",
"Object",
"Ice.Value"
};
static const char* javaScriptBuiltinTable[] =
{
"Number", // byte
"Boolean", // bool
"Number", // short
"Number", // int
"Ice.Long", // long
"Number", // float
"Number", // double
"String",
"Ice.Value",
"Ice.ObjectPrx",
"Object",
"Ice.Value"
};
BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
if(builtin)
{
if(typescript)
{
int kind = (!local && builtin->kind() == Builtin::KindObject) ? Builtin::KindValue : builtin->kind();
ostringstream os;
if(getModuleMetadata(type) == "ice" && getModuleMetadata(toplevel) != "ice")
{
os << "iceNS0.";
}
os << getUnqualified(typeScriptBuiltinTable[kind], toplevel->scope(), "iceNS0.");
return os.str();
}
else
{
return javaScriptBuiltinTable[builtin->kind()];
}
}
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
if(cl)
{
string prefix;
ostringstream os;
if(typescript)
{
if(cl->isInterface() && !local)
{
prefix = importPrefix("Ice.Value", toplevel);
}
else
{
prefix = importPrefix(ContainedPtr::dynamicCast(cl), toplevel, imports);
}
}
os << prefix;
if(!prefix.empty() && typescript)
{
if(cl->isInterface() && !local)
{
os << getUnqualified("Ice.Value", toplevel->scope(), prefix);
}
//.........这里部分代码省略.........