summaryrefslogtreecommitdiff
path: root/cpp/src/slice2docbook/GenUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2docbook/GenUtil.cpp')
-rw-r--r--cpp/src/slice2docbook/GenUtil.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/cpp/src/slice2docbook/GenUtil.cpp b/cpp/src/slice2docbook/GenUtil.cpp
index 52b9c90a4e2..64be85a894f 100644
--- a/cpp/src/slice2docbook/GenUtil.cpp
+++ b/cpp/src/slice2docbook/GenUtil.cpp
@@ -36,27 +36,27 @@ Slice::typeToString(const TypePtr& type)
string result;
BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
- if(builtin)
+ if (builtin)
result = "<type>" + string(builtinTable[builtin -> kind()]) + "</type>";
ProxyPtr proxy = ProxyPtr::dynamicCast(type);
- if(proxy)
+ if (proxy)
result = "<classname>" + proxy -> _class() -> scoped().substr(2) + "*</classname>";
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
- if(cl)
+ if (cl)
result = "<classname>" + cl -> scoped().substr(2) + "</classname>";
ContainedPtr contained = ContainedPtr::dynamicCast(type);
- if(contained)
+ if (contained)
{
- if(result.empty())
+ if (result.empty())
result = "<type>" + contained -> scoped().substr(2) + "</type>";
result = "<link linkend=" + scopedToId(contained -> scoped()) + ">" + result + "</link>";
}
- if(result.empty())
+ if (result.empty())
result = "???";
return result;
@@ -66,32 +66,32 @@ string
Slice::addLink(const string& s, const ContainerPtr& container)
{
TypeList types = container -> lookupType(s, false);
- if(!types.empty())
+ if (!types.empty())
{
string result;
- if(ClassDeclPtr::dynamicCast(types.front()))
+ if (ClassDeclPtr::dynamicCast(types.front()))
result = "<classname>" + s + "</classname>";
else
result = "<type>" + s + "</type>";
ContainedPtr p = ContainedPtr::dynamicCast(types.front());
- if(p)
+ if (p)
result = "<link linkend=" + scopedToId(p -> scoped()) + ">" + result + "</link>";
return result;
}
ContainedList contList = container -> lookupContained(s, false);
- if(!contList.empty())
+ if (!contList.empty())
{
string result = "<link linkend=" + scopedToId(contList.front() -> scoped()) + ">";
- if(ModulePtr::dynamicCast(contList.front()))
+ if (ModulePtr::dynamicCast(contList.front()))
result += "<classname>" + s + "</classname>";
- else if(OperationPtr::dynamicCast(contList.front()))
+ else if (OperationPtr::dynamicCast(contList.front()))
result += "<function>" + s + "</function>";
- else if(DataMemberPtr::dynamicCast(contList.front()))
+ else if (DataMemberPtr::dynamicCast(contList.front()))
result += "<structfield>" + s + "</structfield>";
else
assert(false);
@@ -107,7 +107,7 @@ struct ToFile
{
char operator()(char c)
{
- if(c == ':')
+ if (c == ':')
return '_';
else
return c;
@@ -118,7 +118,7 @@ string
Slice::scopedToFile(const string& scoped)
{
string result;
- if(scoped[0] == ':')
+ if (scoped[0] == ':')
result = scoped.substr(2);
else
result = scoped;
@@ -134,13 +134,13 @@ Slice::scopedToId(const string& scoped)
static int _nextId = 0;
string s;
- if(scoped[0] == ':')
+ if (scoped[0] == ':')
s = scoped.substr(2);
else
s = scoped;
int id = idMap[s];
- if(id == 0)
+ if (id == 0)
{
id = ++_nextId;
idMap[s] = id;