@@ -119,7 +119,7 @@ enum class NodeKind
119119 styled,
120120 tparam,
121121 reference,
122- copied ,
122+ copy_details ,
123123 throws,
124124 details,
125125 see,
@@ -373,7 +373,8 @@ struct Text : Node
373373 {
374374 }
375375
376- bool isBlock () const noexcept final
376+ bool
377+ isBlock () const noexcept final
377378 {
378379 return false ;
379380 }
@@ -600,26 +601,21 @@ tag_invoke(
600601
601602/* * Documentation copied from another symbol.
602603*/
603- struct Copied final : Reference
604+ struct CopyDetails final : Reference
604605{
605- Parts parts ;
606+ static constexpr auto static_kind = NodeKind::copy_details ;
606607
607- static constexpr auto static_kind = NodeKind::copied;
608-
609- Copied (
610- std::string string_ = std::string(),
611- Parts parts_ = Parts::all) noexcept
612- : Reference(std::move(string_), NodeKind::copied)
613- , parts(parts_)
608+ CopyDetails (std::string string_ = std::string()) noexcept
609+ : Reference(std::move(string_), NodeKind::copy_details)
614610 {
615611 }
616612
617- auto operator <=>(Copied const &) const = default ;
618- bool operator ==(Copied const &) const noexcept = default ;
613+ auto operator <=>(CopyDetails const &) const = default ;
614+ bool operator ==(CopyDetails const &) const noexcept = default ;
619615 bool equals (Node const & other) const noexcept override
620616 {
621617 return Kind == other.Kind &&
622- *this == dynamic_cast <Copied const &>(other);
618+ *this == dynamic_cast <CopyDetails const &>(other);
623619 }
624620};
625621
@@ -630,11 +626,10 @@ void
630626tag_invoke (
631627 dom::LazyObjectMapTag t,
632628 IO& io,
633- Copied const & I,
629+ CopyDetails const & I,
634630 DomCorpus const * domCorpus)
635631{
636632 tag_invoke (t, io, dynamic_cast <Reference const &>(I), domCorpus);
637- io.map (" parts" , I.parts );
638633}
639634
640635/* * Return the @ref Copied as a @ref dom::Value object.
644639tag_invoke (
645640 dom::ValueFromTag,
646641 dom::Value& v,
647- Copied const & I,
642+ CopyDetails const & I,
648643 DomCorpus const * domCorpus)
649644{
650645 v = dom::LazyObject (I, domCorpus);
@@ -825,10 +820,11 @@ struct Paragraph : Block
825820{
826821 static constexpr auto static_kind = NodeKind::paragraph;
827822
828- Paragraph () noexcept
829- : Block(NodeKind::paragraph)
830- {
831- }
823+ Paragraph () noexcept : Block(NodeKind::paragraph) {}
824+
825+ virtual
826+ Paragraph&
827+ operator =(std::string_view str);
832828
833829 auto operator <=>(Paragraph const &) const = default ;
834830
@@ -881,11 +877,30 @@ struct Brief final : Paragraph
881877{
882878 static constexpr NodeKind static_kind = NodeKind::brief;
883879
880+ std::vector<std::string> copiedFrom;
881+
884882 Brief () noexcept
885883 : Paragraph(NodeKind::brief)
886884 {
887885 }
888886
887+ explicit
888+ Brief (std::string_view const text)
889+ : Brief()
890+ {
891+ operator =(text);
892+ }
893+
894+ Brief&
895+ operator =(Brief const & other) = default ;
896+
897+ Brief&
898+ operator =(std::string_view const text) override
899+ {
900+ Paragraph::operator =(text);
901+ return *this ;
902+ }
903+
889904 auto operator <=>(Brief const &) const = default ;
890905
891906 bool equals (Node const & other) const noexcept override
@@ -939,8 +954,12 @@ struct Admonition final : Paragraph
939954 {
940955 }
941956
957+ using Paragraph::operator =;
958+
942959 auto operator <=>(Admonition const &) const = default ;
960+
943961 bool operator ==(Admonition const &) const noexcept = default ;
962+
944963 bool equals (Node const & other) const noexcept override
945964 {
946965 return Kind == other.Kind &&
@@ -989,6 +1008,7 @@ struct Code final : Paragraph
9891008 {
9901009 }
9911010
1011+ using Paragraph::operator =;
9921012 auto operator <=>(Code const &) const = default ;
9931013 bool operator ==(Code const &) const noexcept = default ;
9941014 bool equals (Node const & other) const noexcept override
@@ -1034,6 +1054,8 @@ struct ListItem final : Paragraph
10341054 : Paragraph(static_kind)
10351055 {}
10361056
1057+ using Paragraph::operator =;
1058+
10371059 auto operator <=>(ListItem const &) const = default ;
10381060 bool
10391061 operator ==(ListItem const &) const noexcept = default ;
@@ -1093,6 +1115,8 @@ struct UnorderedList final : Paragraph
10931115 {
10941116 }
10951117
1118+ using Paragraph::operator =;
1119+
10961120 auto operator <=>(UnorderedList const & other) const {
10971121 if (auto const cmp = items.size () <=> other.items .size ();
10981122 !std::is_eq (cmp))
@@ -1169,6 +1193,8 @@ struct See final : Paragraph
11691193 {
11701194 }
11711195
1196+ using Paragraph::operator =;
1197+
11721198 auto operator <=>(See const &) const = default ;
11731199
11741200 bool operator ==(See const &)
@@ -1228,6 +1254,30 @@ struct Param final : Paragraph
12281254 {
12291255 }
12301256
1257+ explicit
1258+ Param (
1259+ std::string_view const name,
1260+ std::string_view const text)
1261+ : Param()
1262+ {
1263+ this ->name = name;
1264+ this ->operator =(text);
1265+ }
1266+
1267+ explicit
1268+ Param (Paragraph const & other)
1269+ : Param()
1270+ {
1271+ children = other.children ;
1272+ }
1273+
1274+ Param&
1275+ operator =(std::string_view const text) override
1276+ {
1277+ Paragraph::operator =(text);
1278+ return *this ;
1279+ }
1280+
12311281 auto operator <=>(Param const &) const = default ;
12321282
12331283 bool operator ==(Param const &)
@@ -1279,6 +1329,27 @@ struct Returns final : Paragraph
12791329 {
12801330 }
12811331
1332+ explicit
1333+ Returns (std::string_view const text)
1334+ : Returns()
1335+ {
1336+ operator =(text);
1337+ }
1338+
1339+ explicit
1340+ Returns (Paragraph const & other)
1341+ : Returns()
1342+ {
1343+ children = other.children ;
1344+ }
1345+
1346+ Returns&
1347+ operator =(std::string_view const text) override
1348+ {
1349+ Paragraph::operator =(text);
1350+ return *this ;
1351+ }
1352+
12821353 auto operator <=>(Returns const &) const = default ;
12831354
12841355 bool operator ==(Returns const &)
@@ -1330,6 +1401,8 @@ struct TParam final : Paragraph
13301401 {
13311402 }
13321403
1404+ using Paragraph::operator =;
1405+
13331406 auto operator <=>(TParam const &) const = default ;
13341407 bool operator ==(TParam const &) const noexcept = default ;
13351408 bool equals (Node const & other) const noexcept override
@@ -1384,6 +1457,8 @@ struct Throws final : Paragraph
13841457 {
13851458 }
13861459
1460+ using Paragraph::operator =;
1461+
13871462 auto operator <=>(Throws const &) const = default ;
13881463
13891464 bool operator ==(Throws const &)
@@ -1435,6 +1510,8 @@ struct Precondition final : Paragraph
14351510 {
14361511 }
14371512
1513+ using Paragraph::operator =;
1514+
14381515 auto operator <=>(Precondition const &) const = default ;
14391516
14401517 bool operator ==(Precondition const &)
@@ -1485,6 +1562,8 @@ struct Postcondition : Paragraph
14851562 {
14861563 }
14871564
1565+ using Paragraph::operator =;
1566+
14881567 auto operator <=>(Postcondition const &) const = default ;
14891568
14901569 bool operator ==(Postcondition const &)
@@ -1561,8 +1640,8 @@ visit(
15611640 return visitor.template visit <Link>();
15621641 case NodeKind::reference:
15631642 return visitor.template visit <Reference>();
1564- case NodeKind::copied :
1565- return visitor.template visit <Copied >();
1643+ case NodeKind::copy_details :
1644+ return visitor.template visit <CopyDetails >();
15661645 case NodeKind::list_item:
15671646 return visitor.template visit <ListItem>();
15681647 case NodeKind::unordered_list:
@@ -1698,14 +1777,6 @@ struct MRDOCS_DECL
16981777 postconditions.empty ();
16991778 }
17001779
1701- /* * Return the brief, or nullptr if there is none.
1702- */
1703- doc::Paragraph const *
1704- getBrief (Corpus const & corpus) const noexcept ;
1705-
1706- std::vector<Polymorphic<doc::Block>> const &
1707- getDescription (Corpus const & corpus) const noexcept ;
1708-
17091780 /* * Return the list of top level blocks.
17101781 */
17111782 std::vector<Polymorphic<doc::Block>> const &
0 commit comments