• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Copyright (c) 2006 Joel de Guzman
3     http://spirit.sourceforge.net/
4 
5     Use, modification and distribution is subject to the Boost Software
6     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7     http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
9 
10 // clang-format off
11 
12 /*` This should appear when =stub.cpp= is included. */
13 
14 #include <string>
15 
16 //[ bar
17 //` This is the [*/bar/] function
bar()18 std::string bar()
19 {
20     // return 'em, bar man!
21     return "bar";
22 }
23 /*`
24 Some trailing text here
25 */
26 //]
27 
28 //[ foo
29     /*`
30     This is the [*['foo]] function.
31 
32     This description can have paragraphs...
33 
34     * lists
35     * etc.
36 
37     And any quickbook block markup.
38     */
foo()39 std::string foo()
40 {
41     // return 'em, foo man!
42     return "foo";
43 }
44 //]
45 
46 //[ foo_bar
foo_bar()47 std::string foo_bar() /*< The /Mythical/ FooBar.
48                       See [@http://en.wikipedia.org/wiki/Foobar Foobar for details] >*/
49 {
50     return "foo-bar"; /*< return 'em, foo-bar man! >*/
51 }
52 //]
53 
54 //[ class_
55 class x
56 {
57 public:
58 
59     /*<< Constructor >>*/
x()60     x() : n(0)
61     {
62     }
63 
64     /*<< Destructor >>*/
~x()65     ~x()
66     {
67     }
68 
69     /*<< Get the `n` member variable >>*/
get() const70     int get() const
71     {
72         return n; /*<- this will be ignored by quickbook ->*/
73     }
74 
75     /*<< Set the `n` member variable >>*/
set(int n_)76     void set(int n_)
77     {
78         n = n_;
79     }
80 //<- this will be ignored by quickbook
81 private:
82 
83     int n;
84 //->
85 };
86 //]
87