170ec8419SPeterChou1// RUN: rm -rf %t && mkdir -p %t/docs %t/build 270ec8419SPeterChou1// RUN: sed 's|$test_dir|%/S|g' %S/Inputs/basic-project/database_template.json > %t/build/compile_commands.json 370ec8419SPeterChou1// RUN: clang-doc --format=html --output=%t/docs --executor=all-TUs %t/build/compile_commands.json 470ec8419SPeterChou1// RUN: FileCheck %s -input-file=%t/docs/index_json.js -check-prefix=JSON-INDEX 570ec8419SPeterChou1// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Shape.html -check-prefix=HTML-SHAPE 670ec8419SPeterChou1// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Calculator.html -check-prefix=HTML-CALC 770ec8419SPeterChou1// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Rectangle.html -check-prefix=HTML-RECTANGLE 870ec8419SPeterChou1// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Circle.html -check-prefix=HTML-CIRCLE 970ec8419SPeterChou1 10a9b1e80aSPeterChou1// JSON-INDEX: async function LoadIndex() { 11a9b1e80aSPeterChou1// JSON-INDEX-NEXT: return{ 1270ec8419SPeterChou1// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}", 1370ec8419SPeterChou1// JSON-INDEX-NEXT: "Name": "", 1470ec8419SPeterChou1// JSON-INDEX-NEXT: "RefType": "default", 1570ec8419SPeterChou1// JSON-INDEX-NEXT: "Path": "", 1670ec8419SPeterChou1// JSON-INDEX-NEXT: "Children": [ 1770ec8419SPeterChou1// JSON-INDEX-NEXT: { 1870ec8419SPeterChou1// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}", 1970ec8419SPeterChou1// JSON-INDEX-NEXT: "Name": "GlobalNamespace", 2070ec8419SPeterChou1// JSON-INDEX-NEXT: "RefType": "namespace", 2170ec8419SPeterChou1// JSON-INDEX-NEXT: "Path": "GlobalNamespace", 2270ec8419SPeterChou1// JSON-INDEX-NEXT: "Children": [ 2370ec8419SPeterChou1// JSON-INDEX-NEXT: { 2470ec8419SPeterChou1// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}", 2570ec8419SPeterChou1// JSON-INDEX-NEXT: "Name": "Calculator", 2670ec8419SPeterChou1// JSON-INDEX-NEXT: "RefType": "record", 2770ec8419SPeterChou1// JSON-INDEX-NEXT: "Path": "GlobalNamespace", 2870ec8419SPeterChou1// JSON-INDEX-NEXT: "Children": [] 2970ec8419SPeterChou1// JSON-INDEX-NEXT: }, 3070ec8419SPeterChou1// JSON-INDEX-NEXT: { 3170ec8419SPeterChou1// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}", 3270ec8419SPeterChou1// JSON-INDEX-NEXT: "Name": "Circle", 3370ec8419SPeterChou1// JSON-INDEX-NEXT: "RefType": "record", 3470ec8419SPeterChou1// JSON-INDEX-NEXT: "Path": "GlobalNamespace", 3570ec8419SPeterChou1// JSON-INDEX-NEXT: "Children": [] 3670ec8419SPeterChou1// JSON-INDEX-NEXT: }, 3770ec8419SPeterChou1// JSON-INDEX-NEXT: { 3870ec8419SPeterChou1// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}", 3970ec8419SPeterChou1// JSON-INDEX-NEXT: "Name": "Rectangle", 4070ec8419SPeterChou1// JSON-INDEX-NEXT: "RefType": "record", 4170ec8419SPeterChou1// JSON-INDEX-NEXT: "Path": "GlobalNamespace", 4270ec8419SPeterChou1// JSON-INDEX-NEXT: "Children": [] 4370ec8419SPeterChou1// JSON-INDEX-NEXT: }, 4470ec8419SPeterChou1// JSON-INDEX-NEXT: { 4570ec8419SPeterChou1// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}", 4670ec8419SPeterChou1// JSON-INDEX-NEXT: "Name": "Shape", 4770ec8419SPeterChou1// JSON-INDEX-NEXT: "RefType": "record", 4870ec8419SPeterChou1// JSON-INDEX-NEXT: "Path": "GlobalNamespace", 4970ec8419SPeterChou1// JSON-INDEX-NEXT: "Children": [] 5070ec8419SPeterChou1// JSON-INDEX-NEXT: } 5170ec8419SPeterChou1// JSON-INDEX-NEXT: ] 5270ec8419SPeterChou1// JSON-INDEX-NEXT: } 5370ec8419SPeterChou1// JSON-INDEX-NEXT: ] 54a9b1e80aSPeterChou1// JSON-INDEX-NEXT: }; 55a9b1e80aSPeterChou1// JSON-INDEX-NEXT: } 5670ec8419SPeterChou1 5737211d17SPeterChou1// HTML-SHAPE: <h1>class Shape</h1> 5837211d17SPeterChou1// HTML-SHAPE: <p>Defined at line 8 of file {{.*}}Shape.h</p> 59*c29aba71SPeterChou1// HTML-SHAPE: <div>brief</div> 60*c29aba71SPeterChou1// HTML-SHAPE: <p> Abstract base class for shapes.</p> 6137211d17SPeterChou1// HTML-SHAPE: <p> Provides a common interface for different types of shapes.</p> 6237211d17SPeterChou1// HTML-SHAPE: <h2 id="Functions">Functions</h2> 6337211d17SPeterChou1// HTML-SHAPE: <h3 id="{{([0-9A-F]{40})}}">area</h3> 6437211d17SPeterChou1// HTML-SHAPE: <p>public double area()</p> 65*c29aba71SPeterChou1// HTML-SHAPE: <div>brief</div> 66*c29aba71SPeterChou1// HTML-SHAPE: <p> Calculates the area of the shape.</p> 6737211d17SPeterChou1// HTML-SHAPE: <h3 id="{{([0-9A-F]{40})}}">perimeter</h3> 6837211d17SPeterChou1// HTML-SHAPE: <p>public double perimeter()</p> 69*c29aba71SPeterChou1// HTML-SHAPE: <div>brief</div> 70*c29aba71SPeterChou1// HTML-SHAPE: <p> Calculates the perimeter of the shape.</p> 71*c29aba71SPeterChou1// HTML-SHAPE: <div>return</div> 72*c29aba71SPeterChou1// HTML-SHAPE: <p> double The perimeter of the shape.</p> 733c9e3457SPeterChou1// HTML-SHAPE: <h3 id="{{([0-9A-F]{40})}}">~Shape</h3> 743c9e3457SPeterChou1// HTML-SHAPE: <p>public void ~Shape()</p> 753c9e3457SPeterChou1// HTML-SHAPE: <p>Defined at line 13 of file {{.*}}Shape.h</p> 76*c29aba71SPeterChou1// HTML-SHAPE: <div>brief</div> 77*c29aba71SPeterChou1// HTML-SHAPE: <p> Virtual destructor.</p> 7870ec8419SPeterChou1 7937211d17SPeterChou1// HTML-CALC: <h1>class Calculator</h1> 8037211d17SPeterChou1// HTML-CALC: <p>Defined at line 8 of file {{.*}}Calculator.h</p> 81*c29aba71SPeterChou1// HTML-CALC: <div>brief</div> 82*c29aba71SPeterChou1// HTML-CALC: <p> A simple calculator class.</p> 8337211d17SPeterChou1// HTML-CALC: <p> Provides basic arithmetic operations.</p> 8437211d17SPeterChou1// HTML-CALC: <h2 id="Functions">Functions</h2> 8537211d17SPeterChou1// HTML-CALC: <h3 id="{{([0-9A-F]{40})}}">add</h3> 8637211d17SPeterChou1// HTML-CALC: <p>public int add(int a, int b)</p> 8737211d17SPeterChou1// HTML-CALC: <p>Defined at line 3 of file {{.*}}Calculator.cpp</p> 88*c29aba71SPeterChou1// HTML-CALC: <div>brief</div> 89*c29aba71SPeterChou1// HTML-CALC: <p> Adds two integers.</p> 90*c29aba71SPeterChou1// HTML-CALC: <div>return</div> 91*c29aba71SPeterChou1// HTML-CALC: <p> int The sum of a and b.</p> 9237211d17SPeterChou1// HTML-CALC: <h3 id="{{([0-9A-F]{40})}}">subtract</h3> 9337211d17SPeterChou1// HTML-CALC: <p>public int subtract(int a, int b)</p> 9437211d17SPeterChou1// HTML-CALC: <p>Defined at line 7 of file {{.*}}Calculator.cpp</p> 95*c29aba71SPeterChou1// HTML-CALC: <div>brief</div> 96*c29aba71SPeterChou1// HTML-CALC: <p> Subtracts the second integer from the first.</p> 97*c29aba71SPeterChou1// HTML-CALC: <div>return</div> 98*c29aba71SPeterChou1// HTML-CALC: <p> int The result of a - b.</p> 9937211d17SPeterChou1// HTML-CALC: <h3 id="{{([0-9A-F]{40})}}">multiply</h3> 10037211d17SPeterChou1// HTML-CALC: <p>public int multiply(int a, int b)</p> 10137211d17SPeterChou1// HTML-CALC: <p>Defined at line 11 of file {{.*}}Calculator.cpp</p> 102*c29aba71SPeterChou1// HTML-CALC: <div>brief</div> 103*c29aba71SPeterChou1// HTML-CALC: <p> Multiplies two integers.</p> 104*c29aba71SPeterChou1// HTML-CALC: <div>return</div> 105*c29aba71SPeterChou1// HTML-CALC: <p> int The product of a and b.</p> 10637211d17SPeterChou1// HTML-CALC: <h3 id="{{([0-9A-F]{40})}}">divide</h3> 10737211d17SPeterChou1// HTML-CALC: <p>public double divide(int a, int b)</p> 10837211d17SPeterChou1// HTML-CALC: <p>Defined at line 15 of file {{.*}}Calculator.cpp</p> 109*c29aba71SPeterChou1// HTML-CALC: <div>brief</div> 110*c29aba71SPeterChou1// HTML-CALC: <p> Divides the first integer by the second.</p> 111*c29aba71SPeterChou1// HTML-CALC: <div>return</div> 112*c29aba71SPeterChou1// HTML-CALC: <p> double The result of a / b.</p> 113*c29aba71SPeterChou1// HTML-CALC: <div>throw</div> 114*c29aba71SPeterChou1// HTML-CALC: <p>if b is zero.</p> 11570ec8419SPeterChou1 11637211d17SPeterChou1// HTML-RECTANGLE: <h1>class Rectangle</h1> 11737211d17SPeterChou1// HTML-RECTANGLE: <p>Defined at line 10 of file {{.*}}Rectangle.h</p> 11837211d17SPeterChou1// HTML-RECTANGLE: <p> Represents a rectangle with a given width and height.</p 11937211d17SPeterChou1// HTML-RECTANGLE: <p> 12037211d17SPeterChou1// HTML-RECTANGLE: Inherits from 12137211d17SPeterChou1// HTML-RECTANGLE: <a href="Shape.html">Shape</a> 12237211d17SPeterChou1// HTML-RECTANGLE: </p> 12337211d17SPeterChou1// HTML-RECTANGLE: <h2 id="Members">Members</h2> 124b4bc7b18SPeterChou1// HTML-RECTANGLE: <p> Width of the rectangle.</p> 125b4bc7b18SPeterChou1// HTML-RECTANGLE: <div>private double width_</div> 126b4bc7b18SPeterChou1// HTML-RECTANGLE: <p> Height of the rectangle.</p> 127b4bc7b18SPeterChou1// HTML-RECTANGLE: <div>private double height_</div> 12837211d17SPeterChou1// HTML-RECTANGLE: <h2 id="Functions">Functions</h2> 12937211d17SPeterChou1// HTML-RECTANGLE: <h3 id="{{([0-9A-F]{40})}}">Rectangle</h3> 13037211d17SPeterChou1// HTML-RECTANGLE: <p>public void Rectangle(double width, double height)</p> 13137211d17SPeterChou1// HTML-RECTANGLE: <p>Defined at line 3 of file {{.*}}Rectangle.cpp</p> 132*c29aba71SPeterChou1// HTML-RECTANGLE: <div>brief</div> 133*c29aba71SPeterChou1// HTML-RECTANGLE: <p> Constructs a new Rectangle object.</p> 13437211d17SPeterChou1// HTML-RECTANGLE: <h3 id="{{([0-9A-F]{40})}}">area</h3> 13537211d17SPeterChou1// HTML-RECTANGLE: <p>public double area()</p> 13637211d17SPeterChou1// HTML-RECTANGLE: <p>Defined at line 6 of file {{.*}}Rectangle.cpp</p> 137*c29aba71SPeterChou1// HTML-RECTANGLE: <div>brief</div> 138*c29aba71SPeterChou1// HTML-RECTANGLE: <p> Calculates the area of the rectangle.</p> 139*c29aba71SPeterChou1// HTML-RECTANGLE: <div>return</div> 140*c29aba71SPeterChou1// HTML-RECTANGLE: <p> double The area of the rectangle.</p> 14137211d17SPeterChou1// HTML-RECTANGLE: <h3 id="{{([0-9A-F]{40})}}">perimeter</h3> 14237211d17SPeterChou1// HTML-RECTANGLE: <p>public double perimeter()</p> 14337211d17SPeterChou1// HTML-RECTANGLE: <p>Defined at line 10 of file {{.*}}Rectangle.cpp</p> 144*c29aba71SPeterChou1// HTML-RECTANGLE: <div>brief</div> 145*c29aba71SPeterChou1// HTML-RECTANGLE: <p> Calculates the perimeter of the rectangle.</p> 146*c29aba71SPeterChou1// HTML-RECTANGLE: <div>return</div> 147*c29aba71SPeterChou1// HTML-RECTANGLE: <p> double The perimeter of the rectangle.</p> 14870ec8419SPeterChou1 14937211d17SPeterChou1// HTML-CIRCLE: <h1>class Circle</h1> 15037211d17SPeterChou1// HTML-CIRCLE: <p>Defined at line 10 of file {{.*}}Circle.h</p> 151*c29aba71SPeterChou1// HTML-CIRCLE: <div>brief</div> 152*c29aba71SPeterChou1// HTML-CIRCLE: <p> Circle class derived from Shape.</p> 15337211d17SPeterChou1// HTML-CIRCLE: <p> Represents a circle with a given radius.</p> 15437211d17SPeterChou1// HTML-CIRCLE: <p> 15537211d17SPeterChou1// HTML-CIRCLE: Inherits from 15637211d17SPeterChou1// HTML-CIRCLE: <a href="Shape.html">Shape</a> 15737211d17SPeterChou1// HTML-CIRCLE: </p> 15837211d17SPeterChou1// HTML-CIRCLE: <h2 id="Members">Members</h2> 159b4bc7b18SPeterChou1// HTML-CIRCLE: <p> Radius of the circle.</p> 160b4bc7b18SPeterChou1// HTML-CIRCLE: <div>private double radius_</div> 16137211d17SPeterChou1// HTML-CIRCLE: <h2 id="Functions">Functions</h2> 16237211d17SPeterChou1// HTML-CIRCLE: <h3 id="{{([0-9A-F]{40})}}">Circle</h3> 16337211d17SPeterChou1// HTML-CIRCLE: <p>public void Circle(double radius)</p> 16437211d17SPeterChou1// HTML-CIRCLE: <p>Defined at line 3 of file {{.*}}Circle.cpp</p> 165*c29aba71SPeterChou1// HTML-CIRCLE: <div>brief</div> 166*c29aba71SPeterChou1// HTML-CIRCLE: <p> Constructs a new Circle object.</p> 16737211d17SPeterChou1// HTML-CIRCLE: <h3 id="{{([0-9A-F]{40})}}">area</h3> 16837211d17SPeterChou1// HTML-CIRCLE: <p>public double area()</p> 16937211d17SPeterChou1// HTML-CIRCLE: <p>Defined at line 5 of file {{.*}}Circle.cpp</p> 170*c29aba71SPeterChou1// HTML-CIRCLE: <div>brief</div> 171*c29aba71SPeterChou1// HTML-CIRCLE: <p> Calculates the area of the circle.</p> 172*c29aba71SPeterChou1// HTML-CIRCLE: <div>return</div> 173*c29aba71SPeterChou1// HTML-CIRCLE: <p> double The area of the circle.</p> 17437211d17SPeterChou1// HTML-CIRCLE: <h3 id="{{([0-9A-F]{40})}}">perimeter</h3> 17537211d17SPeterChou1// HTML-CIRCLE: <p>public double perimeter()</p> 17637211d17SPeterChou1// HTML-CIRCLE: <p>Defined at line 9 of file {{.*}}Circle.cpp</p> 177*c29aba71SPeterChou1// HTML-CIRCLE: <div>brief</div> 178*c29aba71SPeterChou1// HTML-CIRCLE: <p> Calculates the perimeter of the circle.</p> 179*c29aba71SPeterChou1// HTML-CIRCLE: <div>return</div> 180*c29aba71SPeterChou1// HTML-CIRCLE: <p> double The perimeter of the circle.</p> 18137211d17SPeterChou1 18237211d17SPeterChou1// MD-CALC: # class Calculator 18337211d17SPeterChou1// MD-CALC: *Defined at .{{[\/]}}include{{[\/]}}Calculator.h#8* 18437211d17SPeterChou1// MD-CALC: **brief** A simple calculator class. 18537211d17SPeterChou1// MD-CALC: Provides basic arithmetic operations. 18637211d17SPeterChou1// MD-CALC: ## Functions 18737211d17SPeterChou1// MD-CALC: ### add 18837211d17SPeterChou1// MD-CALC: *public int add(int a, int b)* 18937211d17SPeterChou1// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#3* 19037211d17SPeterChou1// MD-CALC: **brief** Adds two integers. 19137211d17SPeterChou1// MD-CALC: **a** First integer. 19237211d17SPeterChou1// MD-CALC: **b** Second integer. 19337211d17SPeterChou1// MD-CALC: **return** int The sum of a and b. 19437211d17SPeterChou1// MD-CALC: ### subtract 19537211d17SPeterChou1// MD-CALC: *public int subtract(int a, int b)* 19637211d17SPeterChou1// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#7* 19737211d17SPeterChou1// MD-CALC: **brief** Subtracts the second integer from the first. 19837211d17SPeterChou1// MD-CALC: **a** First integer. 19937211d17SPeterChou1// MD-CALC: **b** Second integer. 20037211d17SPeterChou1// MD-CALC: **return** int The result of a - b. 20137211d17SPeterChou1// MD-CALC: ### multiply 20237211d17SPeterChou1// MD-CALC: *public int multiply(int a, int b)* 20337211d17SPeterChou1// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#11* 20437211d17SPeterChou1// MD-CALC: **brief** Multiplies two integers. 20537211d17SPeterChou1// MD-CALC: **a** First integer. 20637211d17SPeterChou1// MD-CALC: **b** Second integer. 20737211d17SPeterChou1// MD-CALC: **return** int The product of a and b. 20837211d17SPeterChou1// MD-CALC: ### divide 20937211d17SPeterChou1// MD-CALC: *public double divide(int a, int b)* 21037211d17SPeterChou1// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#15* 21137211d17SPeterChou1// MD-CALC: **brief** Divides the first integer by the second. 21237211d17SPeterChou1// MD-CALC: **a** First integer. 21337211d17SPeterChou1// MD-CALC: **b** Second integer. 21437211d17SPeterChou1// MD-CALC: **return** double The result of a / b. 21537211d17SPeterChou1// MD-CALC: **throw**if b is zero. 21637211d17SPeterChou1 21737211d17SPeterChou1// MD-CIRCLE: # class Circle 21837211d17SPeterChou1// MD-CIRCLE: *Defined at .{{[\/]}}include{{[\/]}}Circle.h#10* 21937211d17SPeterChou1// MD-CIRCLE: **brief** Circle class derived from Shape. 22037211d17SPeterChou1// MD-CIRCLE: Represents a circle with a given radius. 22137211d17SPeterChou1// MD-CIRCLE: Inherits from Shape 22237211d17SPeterChou1// MD-CIRCLE: ## Members 22337211d17SPeterChou1// MD-CIRCLE: private double radius_ 22437211d17SPeterChou1// MD-CIRCLE: ## Functions 22537211d17SPeterChou1// MD-CIRCLE: ### Circle 22637211d17SPeterChou1// MD-CIRCLE: *public void Circle(double radius)* 22737211d17SPeterChou1// MD-CIRCLE: *Defined at .{{[\/]}}src{{[\/]}}Circle.cpp#3* 22837211d17SPeterChou1// MD-CIRCLE: **brief** Constructs a new Circle object. 22937211d17SPeterChou1// MD-CIRCLE: **radius** Radius of the circle. 23037211d17SPeterChou1// MD-CIRCLE: ### area 23137211d17SPeterChou1// MD-CIRCLE: *public double area()* 23237211d17SPeterChou1// MD-CIRCLE: *Defined at .{{[\/]}}src{{[\/]}}Circle.cpp#5* 23337211d17SPeterChou1// MD-CIRCLE: **brief** Calculates the area of the circle. 23437211d17SPeterChou1// MD-CIRCLE: **return** double The area of the circle. 23537211d17SPeterChou1// MD-CIRCLE: ### perimeter 23637211d17SPeterChou1// MD-CIRCLE: *public double perimeter()* 23737211d17SPeterChou1// MD-CIRCLE: *Defined at .{{[\/]}}src{{[\/]}}Circle.cpp#9* 23837211d17SPeterChou1// MD-CIRCLE: **brief** Calculates the perimeter of the circle. 23937211d17SPeterChou1// MD-CIRCLE: **return** double The perimeter of the circle. 24037211d17SPeterChou1 24137211d17SPeterChou1// MD-RECTANGLE: # class Rectangle 24237211d17SPeterChou1// MD-RECTANGLE: *Defined at .{{[\/]}}include{{[\/]}}Rectangle.h#10* 24337211d17SPeterChou1// MD-RECTANGLE: **brief** Rectangle class derived from Shape. 24437211d17SPeterChou1// MD-RECTANGLE: Represents a rectangle with a given width and height. 24537211d17SPeterChou1// MD-RECTANGLE: Inherits from Shape 24637211d17SPeterChou1// MD-RECTANGLE: ## Members 24737211d17SPeterChou1// MD-RECTANGLE: private double width_ 24837211d17SPeterChou1// MD-RECTANGLE: private double height_ 24937211d17SPeterChou1// MD-RECTANGLE: ## Functions 25037211d17SPeterChou1// MD-RECTANGLE: ### Rectangle 25137211d17SPeterChou1// MD-RECTANGLE: *public void Rectangle(double width, double height)* 25237211d17SPeterChou1// MD-RECTANGLE: *Defined at .{{[\/]}}src{{[\/]}}Rectangle.cpp#3* 25337211d17SPeterChou1// MD-RECTANGLE: **brief** Constructs a new Rectangle object. 25437211d17SPeterChou1// MD-RECTANGLE: **width** Width of the rectangle. 25537211d17SPeterChou1// MD-RECTANGLE: **height** Height of the rectangle. 25637211d17SPeterChou1// MD-RECTANGLE: ### area 25737211d17SPeterChou1// MD-RECTANGLE: *public double area()* 25837211d17SPeterChou1// MD-RECTANGLE: *Defined at .{{[\/]}}src{{[\/]}}Rectangle.cpp#6* 25937211d17SPeterChou1// MD-RECTANGLE: **brief** Calculates the area of the rectangle. 26037211d17SPeterChou1// MD-RECTANGLE: **return** double The area of the rectangle. 26137211d17SPeterChou1// MD-RECTANGLE: ### perimeter 26237211d17SPeterChou1// MD-RECTANGLE: *public double perimeter()* 26337211d17SPeterChou1// MD-RECTANGLE: *Defined at .{{[\/]}}src{{[\/]}}Rectangle.cpp#10* 26437211d17SPeterChou1// MD-RECTANGLE: **brief** Calculates the perimeter of the rectangle. 26537211d17SPeterChou1// MD-RECTANGLE: **return** double The perimeter of the rectangle. 26637211d17SPeterChou1 26737211d17SPeterChou1// MD-SHAPE: # class Shape 26837211d17SPeterChou1// MD-SHAPE: *Defined at .{{[\/]}}include{{[\/]}}Shape.h#8* 26937211d17SPeterChou1// MD-SHAPE: **brief** Abstract base class for shapes. 27037211d17SPeterChou1// MD-SHAPE: Provides a common interface for different types of shapes. 27137211d17SPeterChou1// MD-SHAPE: ## Functions 27237211d17SPeterChou1// MD-SHAPE: ### ~Shape 27337211d17SPeterChou1// MD-SHAPE: *public void ~Shape()* 27437211d17SPeterChou1// MD-SHAPE: *Defined at .{{[\/]}}include{{[\/]}}Shape.h#13* 27537211d17SPeterChou1// MD-SHAPE: **brief** Virtual destructor. 27637211d17SPeterChou1// MD-SHAPE: ### area 27737211d17SPeterChou1// MD-SHAPE: *public double area()* 27837211d17SPeterChou1// MD-SHAPE: **brief** Calculates the area of the shape. 27937211d17SPeterChou1// MD-SHAPE: **return** double The area of the shape. 28037211d17SPeterChou1// MD-SHAPE: ### perimeter 28137211d17SPeterChou1// MD-SHAPE: *public double perimeter()* 28237211d17SPeterChou1// MD-SHAPE: **brief** Calculates the perimeter of the shape. 28337211d17SPeterChou1// MD-SHAPE: **return** double The perimeter of the shape. 28437211d17SPeterChou1 28537211d17SPeterChou1// MD-ALL-FILES: # All Files 28637211d17SPeterChou1// MD-ALL-FILES: ## [GlobalNamespace](GlobalNamespace{{[\/]}}index.md) 28737211d17SPeterChou1 28837211d17SPeterChou1// MD-INDEX: # C/C++ Reference 28937211d17SPeterChou1// MD-INDEX: * Namespace: [GlobalNamespace](GlobalNamespace)