@@ -214,6 +214,8 @@ DependentNameType::DependentNameType() : Type(TypeKind::DependentName) {}
214
214
215
215
DependentNameType::~DependentNameType () {}
216
216
217
+ DEF_STRING (DependentNameType, Identifier)
218
+
217
219
PackExpansionType::PackExpansionType () : Type(TypeKind::PackExpansion) {}
218
220
219
221
UnaryTransformType::UnaryTransformType () : Type(TypeKind::UnaryTransform) {}
@@ -242,14 +244,16 @@ LayoutField::LayoutField() : offset(0), fieldPtr(0) {}
242
244
243
245
LayoutField::LayoutField (const LayoutField & other)
244
246
: offset(other.offset)
245
- , name (other.name )
247
+ , Name (other.Name )
246
248
, qualifiedType(other.qualifiedType)
247
249
, fieldPtr(other.fieldPtr)
248
250
{
249
251
}
250
252
251
253
LayoutField::~LayoutField () {}
252
254
255
+ DEF_STRING (LayoutField, Name)
256
+
253
257
LayoutBase::LayoutBase () : offset(0 ), _class(0 ) {}
254
258
255
259
LayoutBase::LayoutBase (const LayoutBase& other) : offset(other.offset), _class(other._class) {}
@@ -293,9 +297,9 @@ Declaration::Declaration(const Declaration& rhs)
293
297
, location(rhs.location.ID)
294
298
, lineNumberStart(rhs.lineNumberStart)
295
299
, lineNumberEnd(rhs.lineNumberEnd)
296
- , name (rhs.name )
300
+ , Name (rhs.Name )
297
301
, comment(rhs.comment)
298
- , debugText (rhs.debugText )
302
+ , DebugText (rhs.DebugText )
299
303
, isIncomplete(rhs.isIncomplete)
300
304
, isDependent(rhs.isDependent)
301
305
, isImplicit(rhs.isImplicit)
@@ -312,6 +316,9 @@ Declaration::~Declaration()
312
316
{
313
317
}
314
318
319
+ DEF_STRING (Declaration, Name)
320
+ DEF_STRING (Declaration, USR)
321
+ DEF_STRING (Declaration, DebugText)
315
322
DEF_VECTOR (Declaration, PreprocessedEntity*, PreprocessedEntities)
316
323
DEF_VECTOR (Declaration, Declaration*, Redeclarations)
317
324
@@ -353,7 +360,7 @@ DeclarationContext::FindNamespace(const std::vector<std::string>& Namespaces)
353
360
auto childNamespace = std::find_if (currentNamespace->Namespaces .begin (),
354
361
currentNamespace->Namespaces .end (),
355
362
[&](CppSharp::CppParser::AST::Namespace* ns) {
356
- return ns->name == _namespace;
363
+ return ns->Name == _namespace;
357
364
});
358
365
359
366
if (childNamespace == currentNamespace->Namespaces .end ())
@@ -372,7 +379,7 @@ Namespace* DeclarationContext::FindCreateNamespace(const std::string& Name)
372
379
if (!_namespace)
373
380
{
374
381
_namespace = new Namespace ();
375
- _namespace->name = Name;
382
+ _namespace->Name = Name;
376
383
_namespace->_namespace = this ;
377
384
378
385
Namespaces.push_back (_namespace);
@@ -393,7 +400,7 @@ Class* DeclarationContext::FindClass(const void* OriginalPtr,
393
400
auto _class = std::find_if (Classes.begin (), Classes.end (),
394
401
[OriginalPtr, Name, IsComplete](Class* klass) {
395
402
return (OriginalPtr && klass->originalPtr == OriginalPtr) ||
396
- (klass->name == Name && klass->isIncomplete == !IsComplete); });
403
+ (klass->Name == Name && klass->isIncomplete == !IsComplete); });
397
404
398
405
return _class != Classes.end () ? *_class : nullptr ;
399
406
}
@@ -413,7 +420,7 @@ Class* DeclarationContext::FindClass(const void* OriginalPtr,
413
420
Class* DeclarationContext::CreateClass (const std::string& Name, bool IsComplete)
414
421
{
415
422
auto _class = new Class ();
416
- _class->name = Name;
423
+ _class->Name = Name;
417
424
_class->_namespace = this ;
418
425
_class->isIncomplete = !IsComplete;
419
426
@@ -457,7 +464,7 @@ Enumeration* DeclarationContext::FindEnum(const std::string& Name, bool Create)
457
464
if (entries.size () == 1 )
458
465
{
459
466
auto foundEnum = std::find_if (Enums.begin (), Enums.end (),
460
- [&](Enumeration* _enum) { return _enum->name == Name; });
467
+ [&](Enumeration* _enum) { return _enum->Name == Name; });
461
468
462
469
if (foundEnum != Enums.end ())
463
470
return *foundEnum;
@@ -466,7 +473,7 @@ Enumeration* DeclarationContext::FindEnum(const std::string& Name, bool Create)
466
473
return nullptr ;
467
474
468
475
auto _enum = new Enumeration ();
469
- _enum->name = Name;
476
+ _enum->Name = Name;
470
477
_enum->_namespace = this ;
471
478
Enums.push_back (_enum);
472
479
return _enum;
@@ -525,7 +532,7 @@ Function* DeclarationContext::FindFunction(const std::string& USR)
525
532
TypedefDecl* DeclarationContext::FindTypedef (const std::string& Name, bool Create)
526
533
{
527
534
auto foundTypedef = std::find_if (Typedefs.begin (), Typedefs.end (),
528
- [&](TypedefDecl* tdef) { return tdef->name == Name; });
535
+ [&](TypedefDecl* tdef) { return tdef->Name == Name; });
529
536
530
537
if (foundTypedef != Typedefs.end ())
531
538
return *foundTypedef;
@@ -534,7 +541,7 @@ TypedefDecl* DeclarationContext::FindTypedef(const std::string& Name, bool Creat
534
541
return nullptr ;
535
542
536
543
auto tdef = new TypedefDecl ();
537
- tdef->name = Name;
544
+ tdef->Name = Name;
538
545
tdef->_namespace = this ;
539
546
540
547
return tdef;
@@ -543,7 +550,7 @@ TypedefDecl* DeclarationContext::FindTypedef(const std::string& Name, bool Creat
543
550
TypeAlias* DeclarationContext::FindTypeAlias (const std::string& Name, bool Create)
544
551
{
545
552
auto foundTypeAlias = std::find_if (TypeAliases.begin (), TypeAliases.end (),
546
- [&](TypeAlias* talias) { return talias->name == Name; });
553
+ [&](TypeAlias* talias) { return talias->Name == Name; });
547
554
548
555
if (foundTypeAlias != TypeAliases.end ())
549
556
return *foundTypeAlias;
@@ -552,7 +559,7 @@ TypeAlias* DeclarationContext::FindTypeAlias(const std::string& Name, bool Creat
552
559
return nullptr ;
553
560
554
561
auto talias = new TypeAlias ();
555
- talias->name = Name;
562
+ talias->Name = Name;
556
563
talias->_namespace = this ;
557
564
558
565
return talias;
@@ -596,22 +603,25 @@ Friend::Friend() : CppSharp::CppParser::AST::Declaration(DeclarationKind::Friend
596
603
597
604
Friend::~Friend () {}
598
605
599
- StatementObsolete::StatementObsolete (const std::string& str, StatementClassObsolete stmtClass, Declaration* decl) : string(str), _class(stmtClass), decl(decl) {}
606
+ DEF_STRING (StatementObsolete, String)
607
+
608
+ StatementObsolete::StatementObsolete (const std::string& str, StatementClassObsolete stmtClass, Declaration* decl) : String(str), _class(stmtClass), decl(decl) {}
600
609
601
610
ExpressionObsolete::ExpressionObsolete (const std::string& str, StatementClassObsolete stmtClass, Declaration* decl)
602
611
: StatementObsolete(str, stmtClass, decl) {}
603
612
613
+ DEF_STRING (BinaryOperatorObsolete, OpcodeStr)
614
+
604
615
BinaryOperatorObsolete::BinaryOperatorObsolete (const std::string& str, ExpressionObsolete* lhs, ExpressionObsolete* rhs, const std::string& opcodeStr)
605
- : ExpressionObsolete(str, StatementClassObsolete::BinaryOperator), LHS(lhs), RHS(rhs), opcodeStr (opcodeStr) {}
616
+ : ExpressionObsolete(str, StatementClassObsolete::BinaryOperator), LHS(lhs), RHS(rhs), OpcodeStr (opcodeStr) {}
606
617
607
618
BinaryOperatorObsolete::~BinaryOperatorObsolete ()
608
619
{
609
620
deleteExpression (LHS);
610
621
deleteExpression (RHS);
611
622
}
612
623
613
-
614
- CallExprObsolete::CallExprObsolete (const std::string& str, Declaration* decl)
624
+ CallExprObsolete::CallExprObsolete (const char * str, Declaration* decl)
615
625
: ExpressionObsolete(str, StatementClassObsolete::CallExprClass, decl) {}
616
626
617
627
CallExprObsolete::~CallExprObsolete ()
@@ -622,7 +632,7 @@ CallExprObsolete::~CallExprObsolete()
622
632
623
633
DEF_VECTOR (CallExprObsolete, ExpressionObsolete*, Arguments)
624
634
625
- CXXConstructExprObsolete::CXXConstructExprObsolete (const std::string& str, Declaration* decl)
635
+ CXXConstructExprObsolete::CXXConstructExprObsolete (const char * str, Declaration* decl)
626
636
: ExpressionObsolete(str, StatementClassObsolete::CXXConstructExprClass, decl) {}
627
637
628
638
CXXConstructExprObsolete::~CXXConstructExprObsolete ()
@@ -666,6 +676,10 @@ Function::Function()
666
676
}
667
677
668
678
Function::~Function () {}
679
+
680
+ DEF_STRING (Function, Mangled)
681
+ DEF_STRING (Function, Signature)
682
+ DEF_STRING (Function, Body)
669
683
DEF_VECTOR (Function, Parameter*, Parameters)
670
684
671
685
Method::Method ()
@@ -699,14 +713,16 @@ DEF_VECTOR(Enumeration, Enumeration::Item*, Items)
699
713
Enumeration::Item::Item () : Declaration(DeclarationKind::EnumerationItem) {}
700
714
701
715
Enumeration::Item::Item (const Item& rhs) : Declaration(rhs),
702
- expression (rhs.expression ), value(rhs.value) {}
716
+ Expression (rhs.Expression ), value(rhs.value) {}
703
717
704
718
Enumeration::Item::~Item () {}
705
719
720
+ DEF_STRING (Enumeration::Item, Expression)
721
+
706
722
Enumeration::Item* Enumeration::FindItemByName (const std::string& Name)
707
723
{
708
724
auto foundEnumItem = std::find_if (Items.begin (), Items.end (),
709
- [&](Item* _item) { return _item->name == Name; });
725
+ [&](Item* _item) { return _item->Name == Name; });
710
726
if (foundEnumItem != Items.end ())
711
727
return *foundEnumItem;
712
728
return nullptr ;
@@ -717,6 +733,8 @@ Variable::Variable() : Declaration(DeclarationKind::Variable),
717
733
718
734
Variable::~Variable () {}
719
735
736
+ DEF_STRING (Variable, Mangled)
737
+
720
738
BaseClassSpecifier::BaseClassSpecifier () : type(0 ), offset(0 ) {}
721
739
722
740
Field::Field () : Declaration(DeclarationKind::Field), _class(0 ),
@@ -891,13 +909,21 @@ MacroDefinition::MacroDefinition()
891
909
892
910
MacroDefinition::~MacroDefinition () {}
893
911
912
+ DEF_STRING (MacroDefinition, Name)
913
+ DEF_STRING (MacroDefinition, Expression)
914
+
894
915
MacroExpansion::MacroExpansion () : definition(0 ) { kind = DeclarationKind::MacroExpansion; }
895
916
896
917
MacroExpansion::~MacroExpansion () {}
897
918
919
+ DEF_STRING (MacroExpansion, Name)
920
+ DEF_STRING (MacroExpansion, Text)
921
+
898
922
TranslationUnit::TranslationUnit () { kind = DeclarationKind::TranslationUnit; }
899
923
900
924
TranslationUnit::~TranslationUnit () {}
925
+
926
+ DEF_STRING (TranslationUnit, FileName)
901
927
DEF_VECTOR (TranslationUnit, MacroDefinition*, Macros)
902
928
903
929
NativeLibrary::NativeLibrary ()
@@ -906,6 +932,7 @@ NativeLibrary::NativeLibrary()
906
932
NativeLibrary::~NativeLibrary () {}
907
933
908
934
// NativeLibrary
935
+ DEF_STRING (NativeLibrary, FileName)
909
936
DEF_VECTOR_STRING (NativeLibrary, Symbols)
910
937
DEF_VECTOR_STRING (NativeLibrary, Dependencies)
911
938
@@ -941,14 +968,14 @@ TranslationUnit* ASTContext::FindOrCreateModule(std::string File)
941
968
942
969
auto existingUnit = std::find_if (TranslationUnits.begin (),
943
970
TranslationUnits.end (), [&](TranslationUnit* unit) {
944
- return unit && unit->fileName == normalizedFile;
971
+ return unit && unit->FileName == normalizedFile;
945
972
});
946
973
947
974
if (existingUnit != TranslationUnits.end ())
948
975
return *existingUnit;
949
976
950
977
auto unit = new TranslationUnit ();
951
- unit->fileName = normalizedFile;
978
+ unit->FileName = normalizedFile;
952
979
TranslationUnits.push_back (unit);
953
980
954
981
return unit;
@@ -957,6 +984,9 @@ TranslationUnit* ASTContext::FindOrCreateModule(std::string File)
957
984
// Comments
958
985
Comment::Comment (CommentKind kind) : kind(kind) {}
959
986
987
+ DEF_STRING (RawComment, Text)
988
+ DEF_STRING (RawComment, BriefText)
989
+
960
990
RawComment::RawComment () : fullCommentBlock(0 ) {}
961
991
962
992
RawComment::~RawComment ()
@@ -1007,10 +1037,12 @@ BlockContentComment::BlockContentComment(CommentKind Kind) : Comment(Kind) {}
1007
1037
1008
1038
BlockCommandComment::Argument::Argument () {}
1009
1039
1010
- BlockCommandComment::Argument::Argument (const Argument& rhs) : text (rhs.text ) {}
1040
+ BlockCommandComment::Argument::Argument (const Argument& rhs) : Text (rhs.Text ) {}
1011
1041
1012
1042
BlockCommandComment::Argument::~Argument () {}
1013
1043
1044
+ DEF_STRING (BlockCommandComment::Argument, Text)
1045
+
1014
1046
BlockCommandComment::BlockCommandComment () : BlockContentComment(CommentKind::BlockCommandComment), commandId(0 ), paragraphComment(0 ) {}
1015
1047
1016
1048
BlockCommandComment::BlockCommandComment (CommentKind Kind) : BlockContentComment(Kind), commandId(0 ), paragraphComment(0 ) {}
@@ -1028,6 +1060,8 @@ TParamCommandComment::TParamCommandComment() : BlockCommandComment(CommentKind::
1028
1060
1029
1061
DEF_VECTOR (TParamCommandComment, unsigned , Position)
1030
1062
1063
+ DEF_STRING (VerbatimBlockLineComment, Text)
1064
+
1031
1065
VerbatimBlockComment::VerbatimBlockComment () : BlockCommandComment(CommentKind::VerbatimBlockComment) {}
1032
1066
1033
1067
VerbatimBlockComment::~VerbatimBlockComment ()
@@ -1036,10 +1070,14 @@ VerbatimBlockComment::~VerbatimBlockComment()
1036
1070
delete line;
1037
1071
}
1038
1072
1073
+ VerbatimBlockLineComment::VerbatimBlockLineComment () : Comment(CommentKind::VerbatimBlockLineComment) {}
1074
+
1039
1075
DEF_VECTOR (VerbatimBlockComment, VerbatimBlockLineComment*, Lines)
1040
1076
1041
1077
VerbatimLineComment::VerbatimLineComment () : BlockCommandComment(CommentKind::VerbatimLineComment) {}
1042
1078
1079
+ DEF_STRING (VerbatimLineComment, Text)
1080
+
1043
1081
ParagraphComment::ParagraphComment () : BlockContentComment(CommentKind::ParagraphComment), isWhitespace(false ) {}
1044
1082
1045
1083
ParagraphComment::~ParagraphComment ()
@@ -1079,25 +1117,37 @@ HTMLTagComment::HTMLTagComment(CommentKind Kind) : InlineContentComment(Kind) {}
1079
1117
1080
1118
HTMLStartTagComment::Attribute::Attribute () {}
1081
1119
1082
- HTMLStartTagComment::Attribute::Attribute (const Attribute& rhs) : name(rhs.name), value(rhs.value) {}
1120
+ HTMLStartTagComment::Attribute::Attribute (const Attribute& rhs) : Name(rhs.Name), Value(rhs.Value) {}
1121
+
1122
+ DEF_STRING (HTMLStartTagComment::Attribute, Name)
1123
+
1124
+ DEF_STRING (HTMLStartTagComment::Attribute, Value)
1083
1125
1084
1126
HTMLStartTagComment::Attribute::~Attribute () {}
1085
1127
1086
1128
HTMLStartTagComment::HTMLStartTagComment () : HTMLTagComment(CommentKind::HTMLStartTagComment) {}
1087
1129
1088
1130
DEF_VECTOR (HTMLStartTagComment, HTMLStartTagComment::Attribute, Attributes)
1089
1131
1132
+ DEF_STRING (HTMLStartTagComment, TagName)
1133
+
1090
1134
HTMLEndTagComment::HTMLEndTagComment () : HTMLTagComment(CommentKind::HTMLEndTagComment) {}
1091
1135
1136
+ DEF_STRING (HTMLEndTagComment, TagName)
1137
+
1092
1138
InlineContentComment::InlineContentComment () : Comment(CommentKind::InlineContentComment), hasTrailingNewline(false ) {}
1093
1139
1094
1140
InlineContentComment::InlineContentComment (CommentKind Kind) : Comment(Kind), hasTrailingNewline(false ) {}
1095
1141
1096
1142
TextComment::TextComment () : InlineContentComment(CommentKind::TextComment) {}
1097
1143
1144
+ DEF_STRING (TextComment, Text)
1145
+
1098
1146
InlineCommandComment::Argument::Argument () {}
1099
1147
1100
- InlineCommandComment::Argument::Argument (const Argument& rhs) : text(rhs.text) {}
1148
+ InlineCommandComment::Argument::Argument (const Argument& rhs) : Text(rhs.Text) {}
1149
+
1150
+ DEF_STRING (InlineCommandComment::Argument, Text)
1101
1151
1102
1152
InlineCommandComment::Argument::~Argument () {}
1103
1153
@@ -1106,6 +1156,4 @@ InlineCommandComment::InlineCommandComment()
1106
1156
1107
1157
DEF_VECTOR (InlineCommandComment, InlineCommandComment::Argument, Arguments)
1108
1158
1109
- VerbatimBlockLineComment::VerbatimBlockLineComment () : Comment(CommentKind::VerbatimBlockLineComment) {}
1110
-
1111
1159
} } }
0 commit comments