sl@0: // Copyright Ralf W. Grosse-Kunstleve 2006. sl@0: // Distributed under the Boost Software License, Version 1.0. (See sl@0: // accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: #ifndef DOCSTRING_OPTIONS_RWGK20060111_HPP sl@0: # define DOCSTRING_OPTIONS_RWGK20060111_HPP sl@0: sl@0: #include sl@0: sl@0: namespace boost { namespace python { sl@0: sl@0: // Note: the static data members are defined in object/function.cpp sl@0: sl@0: class BOOST_PYTHON_DECL docstring_options : boost::noncopyable sl@0: { sl@0: public: sl@0: docstring_options(bool show_all=true) sl@0: { sl@0: previous_show_user_defined_ = show_user_defined_; sl@0: previous_show_signatures_ = show_signatures_; sl@0: show_user_defined_ = show_all; sl@0: show_signatures_ = show_all; sl@0: } sl@0: sl@0: docstring_options(bool show_user_defined, bool show_signatures) sl@0: { sl@0: previous_show_user_defined_ = show_user_defined_; sl@0: previous_show_signatures_ = show_signatures_; sl@0: show_user_defined_ = show_user_defined; sl@0: show_signatures_ = show_signatures; sl@0: } sl@0: sl@0: ~docstring_options() sl@0: { sl@0: show_user_defined_ = previous_show_user_defined_; sl@0: show_signatures_ = previous_show_signatures_; sl@0: } sl@0: sl@0: void sl@0: disable_user_defined() { show_user_defined_ = false; } sl@0: sl@0: void sl@0: enable_user_defined() { show_user_defined_ = true; } sl@0: sl@0: void sl@0: disable_signatures() { show_signatures_ = false; } sl@0: sl@0: void sl@0: enable_signatures() { show_signatures_ = true; } sl@0: sl@0: void sl@0: disable_all() sl@0: { sl@0: show_user_defined_ = false; sl@0: show_signatures_ = false; sl@0: } sl@0: sl@0: void sl@0: enable_all() sl@0: { sl@0: show_user_defined_ = true; sl@0: show_signatures_ = true; sl@0: } sl@0: sl@0: friend struct objects::function; sl@0: sl@0: private: sl@0: static volatile bool show_user_defined_; sl@0: static volatile bool show_signatures_; sl@0: bool previous_show_user_defined_; sl@0: bool previous_show_signatures_; sl@0: }; sl@0: sl@0: }} // namespace boost::python sl@0: sl@0: #endif // DOCSTRING_OPTIONS_RWGK20060111_HPP