|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51649 - in trunk: doc libs/signals2/doc libs/signals2/doc/snippets libs/signals2/test
From: fmhess_at_[hidden]
Date: 2009-03-08 12:11:39
Author: fmhess
Date: 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
New Revision: 51649
URL: http://svn.boost.org/trac/boost/changeset/51649
Log:
Generate code snippets using bjam instead of checking them into
svn, to avoid bogus entries in inspect report.
Added:
trunk/libs/signals2/doc/snippets/Jamfile.v2 (contents, props changed)
trunk/libs/signals2/doc/snippets/snippet-extractor.jam (contents, props changed)
Removed:
trunk/libs/signals2/doc/snippets/block_code_snippet.txt
trunk/libs/signals2/doc/snippets/button_declaration_code_snippet.txt
trunk/libs/signals2/doc/snippets/custom_combiners_aggregate_values_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/custom_combiners_aggregate_values_usage_code_snippet.txt
trunk/libs/signals2/doc/snippets/custom_combiners_maximum_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/custom_combiners_maximum_usage_code_snippet.txt
trunk/libs/signals2/doc/snippets/disconnect_by_slot_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/disconnect_by_slot_usage_code_snippet.txt
trunk/libs/signals2/doc/snippets/disconnect_code_snippet.txt
trunk/libs/signals2/doc/snippets/document_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/document_view_main_code_snippet.txt
trunk/libs/signals2/doc/snippets/good_morining_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/good_morning_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/hello_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/hello_world_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/hello_world_multi_code_snippet.txt
trunk/libs/signals2/doc/snippets/hello_world_ordered_code_snippet.txt
trunk/libs/signals2/doc/snippets/hello_world_ordered_invoke_code_snippet.txt
trunk/libs/signals2/doc/snippets/hello_world_single_code_snippet.txt
trunk/libs/signals2/doc/snippets/hex_view_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/passing_slots_defs_code_snippet.txt
trunk/libs/signals2/doc/snippets/passing_slots_usage_code_snippet.txt
trunk/libs/signals2/doc/snippets/scoped_connection_code_snippet.txt
trunk/libs/signals2/doc/snippets/signal_return_value_main_code_snippet.txt
trunk/libs/signals2/doc/snippets/signal_return_value_slot_defs_code_snippet.txt
trunk/libs/signals2/doc/snippets/slot_arguments_main_code_snippet.txt
trunk/libs/signals2/doc/snippets/slot_arguments_slot_defs_code_snippet.txt
trunk/libs/signals2/doc/snippets/text_view_def_code_snippet.txt
trunk/libs/signals2/doc/snippets/world_def_code_snippet.txt
Text files modified:
trunk/doc/Jamfile.v2 | 1 +
trunk/libs/signals2/doc/Jamfile.v2 | 1 +
trunk/libs/signals2/doc/snippets/snippet_extractor.cpp | 14 ++++++++++----
trunk/libs/signals2/test/Jamfile.v2 | 8 +++++---
4 files changed, 17 insertions(+), 7 deletions(-)
Modified: trunk/doc/Jamfile.v2
==============================================================================
--- trunk/doc/Jamfile.v2 (original)
+++ trunk/doc/Jamfile.v2 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
@@ -46,6 +46,7 @@
<dependency>../libs/units/doc//units
<dependency>../libs/unordered/doc//unordered
<dependency>../libs/thread/doc//thread
+ <dependency>../libs/signals2/doc/snippets//
## Add path references to the QuickBook generated docs...
Modified: trunk/libs/signals2/doc/Jamfile.v2
==============================================================================
--- trunk/libs/signals2/doc/Jamfile.v2 (original)
+++ trunk/libs/signals2/doc/Jamfile.v2 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
@@ -5,6 +5,7 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
boostbook standalone : signals.xml :
+ <dependency>./snippets//
<xsl:param>html.stylesheet=../../../../doc/html/boostbook.css
<xsl:param>boost.root=../../../..
<xsl:param>boost.libraries=../../../libraries.htm
Added: trunk/libs/signals2/doc/snippets/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/signals2/doc/snippets/Jamfile.v2 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
@@ -0,0 +1,21 @@
+# Boost.Signals2 Library
+
+# Copyright Frank Mori Hess 2009.
+
+# Use, modification and
+# distribution is subject to the Boost Software License, Version
+# 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+# For more information, see http://www.boost.org
+
+import snippet-extractor ;
+
+exe snippet_extractor : snippet_extractor.cpp ;
+
+make $(BOOST_ROOT)/libs/signals2/doc/snippets/snippet-files
+ : [ glob ../../example/*.cpp ]
+ : snippet-extractor.extract-snippets
+ :
+ <extractor-command>.//snippet_extractor
+ ;
Deleted: trunk/libs/signals2/doc/snippets/block_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/block_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,11 +0,0 @@
- boost::signals2::connection c = sig.connect(HelloWorld());
- std::cout << "c is not blocked.\n";
- sig(); // Prints "Hello, World!"
-
- {
- boost::signals2::shared_connection_block block(c); // block the slot
- std::cout << "c is blocked.\n";
- sig(); // No output: the slot is blocked
- } // shared_connection_block going out of scope unblocks the slot
- std::cout << "c is not blocked.\n";
- sig(); // Prints "Hello, World!"}
Deleted: trunk/libs/signals2/doc/snippets/button_declaration_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/button_declaration_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,14 +0,0 @@
-// a pretend GUI button
-class Button
-{
- typedef boost::signals2::signal<void (int x, int y)> OnClick;
-public:
- typedef OnClick::slot_type OnClickSlotType;
- // forward slots through Button interface to its private signal
- boost::signals2::connection doOnClick(const OnClickSlotType & slot);
-
- // simulate user clicking on GUI button at coordinates 52, 38
- void simulateClick();
-private:
- OnClick onClick;
-};
Deleted: trunk/libs/signals2/doc/snippets/custom_combiners_aggregate_values_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/custom_combiners_aggregate_values_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,19 +0,0 @@
-// aggregate_values is a combiner which places all the values returned
-// from slots into a container
-template<typename Container>
-struct aggregate_values
-{
- typedef Container result_type;
-
- template<typename InputIterator>
- Container operator()(InputIterator first, InputIterator last) const
- {
- Container values;
-
- while(first != last) {
- values.push_back(*first);
- ++first;
- }
- return values;
- }
-};
Deleted: trunk/libs/signals2/doc/snippets/custom_combiners_aggregate_values_usage_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/custom_combiners_aggregate_values_usage_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,10 +0,0 @@
- sig.connect("ient);
- sig.connect(&product);
- sig.connect(&sum);
- sig.connect(&difference);
-
- std::vector<float> results = sig(5, 3);
- std::cout << "aggregate values: ";
- std::copy(results.begin(), results.end(),
- std::ostream_iterator<float>(std::cout, " "));
- std::cout << "\n";
Deleted: trunk/libs/signals2/doc/snippets/custom_combiners_maximum_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/custom_combiners_maximum_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,22 +0,0 @@
-// combiner which returns the maximum value returned by all slots
-template<typename T>
-struct maximum
-{
- typedef T result_type;
-
- template<typename InputIterator>
- T operator()(InputIterator first, InputIterator last) const
- {
- // If there are no slots to call, just return the
- // default-constructed value
- if(first == last ) return T();
- T max_value = *first++;
- while (first != last) {
- if (max_value < *first)
- max_value = *first;
- ++first;
- }
-
- return max_value;
- }
-};
Deleted: trunk/libs/signals2/doc/snippets/custom_combiners_maximum_usage_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/custom_combiners_maximum_usage_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,8 +0,0 @@
- sig.connect(&product);
- sig.connect("ient);
- sig.connect(&sum);
- sig.connect(&difference);
-
- // Outputs the maximum value returned by the connected slots, in this case
- // 15 from the product function.
- std::cout << "maximum: " << sig(5, 3) << std::endl;
Deleted: trunk/libs/signals2/doc/snippets/disconnect_by_slot_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/disconnect_by_slot_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,2 +0,0 @@
-void foo() { std::cout << "foo"; }
-void bar() { std::cout << "bar\n"; }
Deleted: trunk/libs/signals2/doc/snippets/disconnect_by_slot_usage_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/disconnect_by_slot_usage_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,7 +0,0 @@
- sig.connect(&foo);
- sig.connect(&bar);
- sig();
-
- // disconnects foo, but not bar
- sig.disconnect(&foo);
- sig();
Deleted: trunk/libs/signals2/doc/snippets/disconnect_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/disconnect_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,7 +0,0 @@
- boost::signals2::connection c = sig.connect(HelloWorld());
- std::cout << "c is connected\n";
- sig(); // Prints "Hello, World!"
-
- c.disconnect(); // Disconnect the HelloWorld object
- std::cout << "c is disconnected\n";
- sig(); // Does nothing: there are no connected slots
Deleted: trunk/libs/signals2/doc/snippets/document_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/document_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,31 +0,0 @@
-class Document
-{
-public:
- typedef boost::signals2::signal<void ()> signal_t;
-
-public:
- Document()
- {}
-
- /* Connect a slot to the signal which will be emitted whenever
- text is appended to the document. */
- boost::signals2::connection connect(const signal_t::slot_type &subscriber)
- {
- return m_sig.connect(subscriber);
- }
-
- void append(const char* s)
- {
- m_text += s;
- m_sig();
- }
-
- const std::string& getText() const
- {
- return m_text;
- }
-
-private:
- signal_t m_sig;
- std::string m_text;
-};
Deleted: trunk/libs/signals2/doc/snippets/document_view_main_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/document_view_main_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,9 +0,0 @@
-int main(int argc, char* argv[])
-{
- Document doc;
- TextView v1(doc);
- HexView v2(doc);
-
- doc.append(argc == 2 ? argv[1] : "Hello world!");
- return 0;
-}
Deleted: trunk/libs/signals2/doc/snippets/good_morining_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/good_morining_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,7 +0,0 @@
-struct GoodMorning
-{
- void operator()() const
- {
- std::cout << "... and good morning!" << std::endl;
- }
-};
Deleted: trunk/libs/signals2/doc/snippets/good_morning_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/good_morning_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,7 +0,0 @@
-struct GoodMorning
-{
- void operator()() const
- {
- std::cout << "... and good morning!" << std::endl;
- }
-};
Deleted: trunk/libs/signals2/doc/snippets/hello_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/hello_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,7 +0,0 @@
-struct Hello
-{
- void operator()() const
- {
- std::cout << "Hello";
- }
-};
Deleted: trunk/libs/signals2/doc/snippets/hello_world_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/hello_world_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,7 +0,0 @@
-struct HelloWorld
-{
- void operator()() const
- {
- std::cout << "Hello, World!" << std::endl;
- }
-};
Deleted: trunk/libs/signals2/doc/snippets/hello_world_multi_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/hello_world_multi_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,6 +0,0 @@
- boost::signals2::signal<void ()> sig;
-
- sig.connect(Hello());
- sig.connect(World());
-
- sig();
Deleted: trunk/libs/signals2/doc/snippets/hello_world_ordered_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/hello_world_ordered_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,4 +0,0 @@
- boost::signals2::signal<void ()> sig;
-
- sig.connect(1, World()); // connect with group 1
- sig.connect(0, Hello()); // connect with group 0
Deleted: trunk/libs/signals2/doc/snippets/hello_world_ordered_invoke_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/hello_world_ordered_invoke_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,8 +0,0 @@
- // by default slots are connected at the end of the slot list
- sig.connect(GoodMorning());
-
- // slots are invoked this order:
- // 1) ungrouped slots connected with boost::signals2::at_front
- // 2) grouped slots according to ordering of their groups
- // 3) ungrouped slots connected with boost::signals2::at_back
- sig();
Deleted: trunk/libs/signals2/doc/snippets/hello_world_single_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/hello_world_single_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,9 +0,0 @@
- // Signal with no arguments and a void return value
- boost::signals2::signal<void ()> sig;
-
- // Connect a HelloWorld slot
- HelloWorld hello;
- sig.connect(hello);
-
- // Call all of the slots
- sig();
Deleted: trunk/libs/signals2/doc/snippets/hex_view_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/hex_view_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,28 +0,0 @@
-class HexView
-{
-public:
- HexView(Document& doc): m_document(doc)
- {
- m_connection = m_document.connect(boost::bind(&HexView::refresh, this));
- }
-
- ~HexView()
- {
- m_connection.disconnect();
- }
-
- void refresh() const
- {
- const std::string& s = m_document.getText();
-
- std::cout << "HexView:";
-
- for (std::string::const_iterator it = s.begin(); it != s.end(); ++it)
- std::cout << ' ' << std::hex << static_cast<int>(*it);
-
- std::cout << std::endl;
- }
-private:
- Document& m_document;
- boost::signals2::connection m_connection;
-};
Deleted: trunk/libs/signals2/doc/snippets/passing_slots_defs_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/passing_slots_defs_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,29 +0,0 @@
-// a pretend GUI button
-class Button
-{
- typedef boost::signals2::signal<void (int x, int y)> OnClick;
-public:
- typedef OnClick::slot_type OnClickSlotType;
- // forward slots through Button interface to its private signal
- boost::signals2::connection doOnClick(const OnClickSlotType & slot);
-
- // simulate user clicking on GUI button at coordinates 52, 38
- void simulateClick();
-private:
- OnClick onClick;
-};
-
-boost::signals2::connection Button::doOnClick(const OnClickSlotType & slot)
-{
- return onClick.connect(slot);
-}
-
-void Button::simulateClick()
-{
- onClick(52, 38);
-}
-
-void printCoordinates(long x, long y)
-{
- std::cout << "(" << x << ", " << y << ")\n";
-}
Deleted: trunk/libs/signals2/doc/snippets/passing_slots_usage_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/passing_slots_usage_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,3 +0,0 @@
- Button button;
- button.doOnClick(&printCoordinates);
- button.simulateClick();
Deleted: trunk/libs/signals2/doc/snippets/scoped_connection_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/scoped_connection_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,6 +0,0 @@
- {
- boost::signals2::scoped_connection c(sig.connect(ShortLived()));
- sig(); // will call ShortLived function object
- } // scoped_connection goes out of scope and disconnects
-
- sig(); // ShortLived function object no longer connected to sig
Deleted: trunk/libs/signals2/doc/snippets/signal_return_value_main_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/signal_return_value_main_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,9 +0,0 @@
- sig.connect(&product);
- sig.connect("ient);
- sig.connect(&sum);
- sig.connect(&difference);
-
- // The default combiner returns a boost::optional containing the return
- // value of the last slot in the slot list, in this case the
- // difference function.
- std::cout << *sig(5, 3) << std::endl;
Deleted: trunk/libs/signals2/doc/snippets/signal_return_value_slot_defs_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/signal_return_value_slot_defs_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,4 +0,0 @@
-float product(float x, float y) { return x * y; }
-float quotient(float x, float y) { return x / y; }
-float sum(float x, float y) { return x + y; }
-float difference(float x, float y) { return x - y; }
Deleted: trunk/libs/signals2/doc/snippets/slot_arguments_main_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/slot_arguments_main_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,9 +0,0 @@
- boost::signals2::signal<void (float, float)> sig;
-
- sig.connect(&print_args);
- sig.connect(&print_sum);
- sig.connect(&print_product);
- sig.connect(&print_difference);
- sig.connect(&print_quotient);
-
- sig(5., 3.);
Deleted: trunk/libs/signals2/doc/snippets/slot_arguments_slot_defs_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/slot_arguments_slot_defs_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,24 +0,0 @@
-void print_args(float x, float y)
-{
- std::cout << "The arguments are " << x << " and " << y << std::endl;
-}
-
-void print_sum(float x, float y)
-{
- std::cout << "The sum is " << x + y << std::endl;
-}
-
-void print_product(float x, float y)
-{
- std::cout << "The product is " << x * y << std::endl;
-}
-
-void print_difference(float x, float y)
-{
- std::cout << "The difference is " << x - y << std::endl;
-}
-
-void print_quotient(float x, float y)
-{
- std::cout << "The quotient is " << x / y << std::endl;
-}
Added: trunk/libs/signals2/doc/snippets/snippet-extractor.jam
==============================================================================
--- (empty file)
+++ trunk/libs/signals2/doc/snippets/snippet-extractor.jam 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
@@ -0,0 +1,25 @@
+# Boost.Signals2 Library
+
+# Copyright Frank Mori Hess 2009.
+
+# Use, modification and
+# distribution is subject to the Boost Software License, Version
+# 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+# For more information, see http://www.boost.org
+
+import feature ;
+import toolset ;
+
+feature.feature extractor-command : : free dependency ;
+toolset.flags snippet-extractor.extract-snippets EXTRACTOR-COMMAND <extractor-command> ;
+
+rule extract-snippets ( target : sources * : properties * )
+{
+ DEPENDS $(target) : [ on $(target) return $(EXTRACTOR_COMMAND) ] ;
+}
+actions extract-snippets bind EXTRACTOR-COMMAND
+{
+ $(EXTRACTOR-COMMAND) $(<:D) $(>)
+}
Modified: trunk/libs/signals2/doc/snippets/snippet_extractor.cpp
==============================================================================
--- trunk/libs/signals2/doc/snippets/snippet_extractor.cpp (original)
+++ trunk/libs/signals2/doc/snippets/snippet_extractor.cpp 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
@@ -15,11 +15,17 @@
int main(int argc, const char *argv[])
{
- static const unsigned num_files = argc - 1;
- unsigned i;
+ if(argc < 3)
+ {
+ std::cerr << "Too few arguments: need output directory and input file name(s).\n";
+ return -1;
+ }
+ static const std::string output_directory = argv[1];
+ static const int num_files = argc - 2;
+ int i;
for(i = 0; i < num_files; ++i)
{
- const std::string file_name = argv[1 + i];
+ const std::string file_name = argv[2 + i];
std::cout << "opening file: " << file_name << std::endl;
std::ifstream infile(file_name.c_str());
bool inside_snippet = false;
@@ -58,7 +64,7 @@
throw std::runtime_error("failed to obtain snippet name");
}
snippet_out_file.close();
- snippet_out_file.open(std::string(snippet_name + ".txt").c_str());
+ snippet_out_file.open(std::string(output_directory + "/" + snippet_name + ".txt").c_str());
std::cout << "processing snippet \"" << snippet_name << "\"... ";
continue;
}
Deleted: trunk/libs/signals2/doc/snippets/text_view_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/text_view_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,21 +0,0 @@
-class TextView
-{
-public:
- TextView(Document& doc): m_document(doc)
- {
- m_connection = m_document.connect(boost::bind(&TextView::refresh, this));
- }
-
- ~TextView()
- {
- m_connection.disconnect();
- }
-
- void refresh() const
- {
- std::cout << "TextView: " << m_document.getText() << std::endl;
- }
-private:
- Document& m_document;
- boost::signals2::connection m_connection;
-};
Deleted: trunk/libs/signals2/doc/snippets/world_def_code_snippet.txt
==============================================================================
--- trunk/libs/signals2/doc/snippets/world_def_code_snippet.txt 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
+++ (empty file)
@@ -1,7 +0,0 @@
-struct World
-{
- void operator()() const
- {
- std::cout << ", World!" << std::endl;
- }
-};
Modified: trunk/libs/signals2/test/Jamfile.v2
==============================================================================
--- trunk/libs/signals2/test/Jamfile.v2 (original)
+++ trunk/libs/signals2/test/Jamfile.v2 2009-03-08 12:11:36 EDT (Sun, 08 Mar 2009)
@@ -1,6 +1,8 @@
-# Boost.Signals Library
+# Boost.Signals2 Library
-# Copyright Douglas Gregor 2001-2003. Use, modification and
+# Copyright Douglas Gregor 2001-2003.
+# Copyright Frank Mori Hess 2009.
+# Use, modification and
# distribution is subject to the Boost Software License, Version
# 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
@@ -28,7 +30,7 @@
{
test-suite signals2
- :
+ :
[ run connection_test.cpp ]
[ run dead_slot_test.cpp ]
[ run deconstruct_test.cpp ]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk