Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/api-doc-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkatsiaryna_bialiatka <katsiaryna_bialiatka@epam.com>2017-12-22 19:15:31 +0300
committerJoel Martinez <joelmartinez@gmail.com>2018-01-12 01:11:42 +0300
commit6533035ec31f38543532568bc499aba2a98e1788 (patch)
treec9e7e3bdefd3299bfbf28dd5bd6b5bcc43fd988f /mdoc/Mono.Documentation/Updater/DocUtils.cs
parent8ff2931c4e40e1c3687e8efa6fb4e8078b3a3c4b (diff)
[mdoc] Support for C++ signatures
Closes #132
Diffstat (limited to 'mdoc/Mono.Documentation/Updater/DocUtils.cs')
-rw-r--r--mdoc/Mono.Documentation/Updater/DocUtils.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/mdoc/Mono.Documentation/Updater/DocUtils.cs b/mdoc/Mono.Documentation/Updater/DocUtils.cs
index b6eabffe..83543f90 100644
--- a/mdoc/Mono.Documentation/Updater/DocUtils.cs
+++ b/mdoc/Mono.Documentation/Updater/DocUtils.cs
@@ -66,6 +66,14 @@ namespace Mono.Documentation.Updater
propagateStyle ();
}
}
+ public static string GetFormattedTypeName(string name)
+ {
+ int index = name.IndexOf("`", StringComparison.Ordinal);
+ if (index >= 0)
+ return name.Substring(0, index);
+
+ return name;
+ }
public static void AddApiStyle (this XmlNode node, ApiStyle style)
{
string styleString = style.ToString ().ToLowerInvariant ();
@@ -169,8 +177,11 @@ namespace Mono.Documentation.Updater
GetMember (pi.Name)});
}
- public static string GetNamespace (TypeReference type)
+ public static string GetNamespace (TypeReference type, string delimeter = null)
{
+ if (type == null)
+ return string.Empty;
+
if (type.GetElementType ().IsNested)
type = type.GetElementType ();
while (type != null && type.IsNested)
@@ -180,12 +191,17 @@ namespace Mono.Documentation.Updater
string typeNS = type.Namespace;
+ if (!string.IsNullOrEmpty(delimeter))
+ {
+ typeNS = typeNS.Replace(".", delimeter);
+ }
+
// first, make sure this isn't a type reference to another assembly/module
bool isInAssembly = MDocUpdater.IsInAssemblies (type.Module.Name);
if (isInAssembly && !typeNS.StartsWith ("System") && MDocUpdater.HasDroppedNamespace (type))
{
- typeNS = string.Format ("{0}.{1}", MDocUpdater.droppedNamespace, typeNS);
+ typeNS = string.Format ("{0}{1}{2}", MDocUpdater.droppedNamespace, delimeter ?? ".", typeNS);
}
return typeNS;
}