From 2c33663be7446453ca4333ea198dd375078d348f Mon Sep 17 00:00:00 2001 From: fbbrokken Date: Mon, 30 Jul 2007 10:47:25 +0000 Subject: [PATCH] Repaired split index entries, added icmake/svnclean for local use git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@120 f6dd340e-d3f9-0310-b409-bdd246841980 --- bin/createhtml | 10 ++++++++-- bin/createtxt | 5 ++++- bin/latexarchive | 5 ++++- build | 5 +++++ icmake/svnclean | 13 +++++++++++++ yo/inheritance/related.yo | 11 ++++++----- yo/iostreams/streambuf.yo | 10 ++++++---- yo/polymorphism/intro.yo | 2 +- 8 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 icmake/svnclean diff --git a/bin/createhtml b/bin/createhtml index 62d4d28b..838e00ff 100755 --- a/bin/createhtml +++ b/bin/createhtml @@ -9,7 +9,10 @@ Converting .yo to .html yodl2html --no-warnings -l3 cplusplus -[ $? == 0 ] || (echo html conversion failed; exit 1) +if [ $? != 0 ] ; then + echo html conversion failed + exit 1 +fi echo 1>&2 " Moving .html files to ../html @@ -37,7 +40,10 @@ Constructing the html-index. ../bin/htmlindex # construct index page -[ $? == 0 ] || (echo index construction not without errors; exit 1) +if [ $? != 0 ] ; then + echo index construction not without errors + exit 1 +fi echo 1>&2 " diff --git a/bin/createtxt b/bin/createtxt index 6bb32948..8883574e 100755 --- a/bin/createtxt +++ b/bin/createtxt @@ -4,6 +4,9 @@ cd ../yo yodl2txt --no-warnings -l3 cplusplus -[ $? == 0 ] || (echo text conversion failed; exit 1) +if [ $? != 0 ] ; then + echo text conversion failed + exit 1 +fi mv cplusplus.txt ../zip diff --git a/bin/latexarchive b/bin/latexarchive index 64160307..82f8cdb8 100755 --- a/bin/latexarchive +++ b/bin/latexarchive @@ -4,7 +4,10 @@ cd ../yo yodl2latex cplusplus -[ $? == 0 ] || (echo latex conversion failed; exit 1) +if [ $? != 0 ] ; then + echo latex conversion failed + exit 1 +fi mv cplusplus.latex ../latex diff --git a/build b/build index d8f553a9..ee65b431 100755 --- a/build +++ b/build @@ -14,6 +14,7 @@ string #include "icmake/man" #include "icmake/docs" #include "icmake/install" +#include "icmake/svnclean" void main(int argc, list argv, list envp) { @@ -35,6 +36,9 @@ void main(int argc, list argv, list envp) exit(0); } + if (option == "svnclean") + svnclean(); + if (option == "docs") docs(); @@ -64,6 +68,7 @@ void main(int argc, list argv, list envp) " below \n" " man - build the manual page (requires Yodl)\n" " programs - build support programs\n" + " svnclean - clean remnants of locally run ./bin/ scripts\n" "\n" ); exit(1); diff --git a/icmake/svnclean b/icmake/svnclean new file mode 100644 index 00000000..7aa3813a --- /dev/null +++ b/icmake/svnclean @@ -0,0 +1,13 @@ +void svnclean() +{ + run("rm -f script.log {yo,html,latex}/legal.shtml html/cplusplus*.html"); + run("rm -f html/target.shtml html/contents.html html/index.html"); + run("rm -f html/cppindex.html html/cplusplus.index"); + run("rm -f latex/*.{log,toc,aux,out,ind,ilg,idx,dvi,latex}"); + + exit(0); +} + + + + diff --git a/yo/inheritance/related.yo b/yo/inheritance/related.yo index e3d3a7a6..41f280f9 100644 --- a/yo/inheritance/related.yo +++ b/yo/inheritance/related.yo @@ -55,11 +55,12 @@ functionality, just extra code. Clearly this code duplication is superfluous: a tt(Land) should em(be) a tt(Vehicle); it should not em(contain) a tt(Vehicle). - The intended relationship is achieved better by i(inheritance). A i(rule -of thumb) for choosing between inheritance and composition distinguishes -between em(is-a) and em(has-a) relationships. A truck em(is) a vehicle, so -Truck should probably derive from Vehicle. On the other hand, a truck em(has) -an engine; if you need to model engines in your system, you should probably + The intended relationship is achieved better by i(inheritance). + A i(rule of thumb) + for choosing between inheritance and composition distinguishes between +em(is-a) and em(has-a) relationships. A truck em(is) a vehicle, so Truck +should probably derive from Vehicle. On the other hand, a truck em(has) an +engine; if you need to model engines in your system, you should probably express this by composing an Engine class with the Truck class. Following the above rule, tt(Land) is em(derived) from tt(Vehicle), in which diff --git a/yo/iostreams/streambuf.yo b/yo/iostreams/streambuf.yo index 1b3f46c9..7068831b 100644 --- a/yo/iostreams/streambuf.yo +++ b/yo/iostreams/streambuf.yo @@ -18,10 +18,12 @@ to decouple the tt(stream) classes from the hi(device) devices they operate upon. The rationale here is to use an extra software layer between, on the one hand, the classes allowing us to communicate with the device and, on the other hand, the communication between the software and the devices themselves. This -implements a emi(chain of command) which is seen regularly in i(software -design): The em(chain of command) is considered a generic pattern for the -construction of i(reusable software), encountered also in, e.g., the i(TCP/IP -stack). A tt(streambuf) can be considered yet another example of the chain of +implements a emi(chain of command) which is seen regularly in + i(software design): + The em(chain of command) is considered a generic pattern for the +construction of i(reusable software), encountered also in, e.g., the + i(TCP/IP stack). + A tt(streambuf) can be considered yet another example of the chain of command pattern: here the program talks to tt(stream) objects, which in turn forward their requests to tt(streambuf) objects, which in turn communicate with the devices. Thus, as we will see shortly, we are now able to do in diff --git a/yo/polymorphism/intro.yo b/yo/polymorphism/intro.yo index 58d1d40e..5d2cf301 100644 --- a/yo/polymorphism/intro.yo +++ b/yo/polymorphism/intro.yo @@ -31,7 +31,7 @@ called. By default emi(static binding) (or emi(early binding)) is used: the class types of objects, object pointers or object refences determine which member functions are called. Late binding is an inherently different (and somewhat slower) procdure since it is decided i(run-time), rather than -i(compile-time) what function is called (see section ref(howpolymorphism) for +i(compile-time) what function is called (see section ref(howpolymorfism) for details). As bf(C++) supports em(both) late- and early-binding bf(C++) programmers are offered an option in what kind of binding to use, and so choices can be optimized to the situations at hand. Many other languages