stub.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*=============================================================================
  2. Copyright (c) 2006 Joel de Guzman
  3. http://spirit.sourceforge.net/
  4. Use, modification and distribution is subject to the Boost Software
  5. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. =============================================================================*/
  8. #include <string>
  9. //[ bar
  10. //` This is the [*/bar/] function
  11. std::string bar()
  12. {
  13. // return 'em, bar man!
  14. return "bar";
  15. }
  16. //]
  17. //[ foo
  18. /*` This is the [*['foo]] function. */
  19. std::string foo()
  20. {
  21. // return 'em, foo man!
  22. return "foo";
  23. }
  24. //]
  25. //[ foo_bar
  26. std::string foo_bar() /*< The /Mythical/ FooBar.
  27. See [@http://en.wikipedia.org/wiki/Foobar Foobar for details] >*/
  28. {
  29. return "foo-bar"; /*< return 'em, foo-bar man! >*/
  30. }
  31. //]
  32. //[ class_
  33. class x
  34. {
  35. public:
  36. /*<< Constructor >>*/
  37. x() : n(0)
  38. {
  39. }
  40. /*<< Destructor >>*/
  41. ~x()
  42. {
  43. }
  44. /*<< Get the `n` member variable >>*/
  45. int get() const
  46. {
  47. return n; /*<- this will be ignored by quickbook ->*/
  48. }
  49. /*<< Set the `n` member variable >>*/
  50. void set(int n_)
  51. {
  52. n = n_;
  53. }
  54. //<- this will be ignored by quickbook
  55. private:
  56. int n;
  57. //->
  58. };
  59. //]
粤ICP备19079148号