This repository was archived by the owner on Feb 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCppArticleGenerator.cs
More file actions
51 lines (46 loc) · 1.57 KB
/
CppArticleGenerator.cs
File metadata and controls
51 lines (46 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
namespace Microsoft.Content.Build.Code2Yaml.ArticleGenerator
{
using System.Collections.Generic;
using System.Text;
using System.Xml.Linq;
using GitSharp;
using Microsoft.Content.Build.Code2Yaml.Common;
using Microsoft.Content.Build.Code2Yaml.DataContracts;
using Microsoft.Content.Build.Code2Yaml.DeclarationGenerator;
using Microsoft.Content.Build.Code2Yaml.NameGenerator;
public class CppArticleGenerator : BasicArticleGenerator
{
public CppArticleGenerator() : base(new CppNameGenerator(), new CppDeclarationGenerator())
{
}
public override string Language
{
get
{
return "cplusplus";
}
}
protected override void FillLanguageSpecificMetadata(ArticleItemYaml yaml, ArticleContext context, XElement node)
{
HierarchyChange curChange = context.CurrentChange;
HierarchyChange parentChange = context.ParentChange;
yaml.NamespaceName = parentChange?.Uid;
FillHeader(yaml, node);
}
protected override ReferenceViewModel CreateReferenceWithSpec(string uid, List<SpecViewModel> specs)
{
return new ReferenceViewModel
{
Uid = uid,
SpecForCpp = specs,
};
}
protected override IEnumerable<string> GetDefaultInheritance(ArticleItemYaml yaml)
{
if (yaml.Type == MemberType.Class)
{
yield return "System::Object";
}
}
}
}