English document is under construction. Now, Japanese and English are written together.
This library is a STL like tree container.
STL ライクな木のコンテナライブラリです。小さな木のライブラリなので苗木(sapling)と名づけてみました。
#include <gslib/sapling/tree.h> using namespace gslib; using namespace sapling; tree< int > t; // create root as 100 // 100 のルートを作成 tree< int >::iterator rt = t.insert( t.end(), 100 ); // create 10, 11 as root's children // 10, 11 をルートの子として作成 t.insert( rt.end(), 10 ); t.insert( rt.end(), 11 ); // erase all notdes under rt. ( this case is same with clear ) // rt 以下を削除 ( クリアと同じ ) t.erase( rt );
#include <gslib/sapling/tree.h> #include <gslib/sapling/dump.h> using namespace gslib; using namespace sapling; tree< int > t; // insert nodes in t. // t にノードを挿入 ... dump( t, std::cout );
#include <gslib/sapling/tree.h> #include <gslib/sapling/scribble.h> // 以下の木を作る。 // make following tree. // // 0 // 1 // 2 // 3 // 4 // 5 // 6 // 7 // 8 // 9 // 10 tree< int > t; scribble( t ) .b( 0 ) // 子を持つノードは .b()。xml での <tag> ( 1 ) ( 2 ) // 子を持たないノードは ( ? )。xml での <tag/> .b( 3 ).e() // .b( ? ).e() と () は同じ .e() ( 4 ) ( 5 ) .b( 6 ) ( 7 ) ( 8 ) .e() ( 9 ) .e() ( 10 ) .e(); // 終了タグ .e()。xml での </tag>
このライブラリは、boost に依存しています。
Copyright (C) 2004 &o
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
-----------------------------------------------------------------------------------------
商用利用していただいても、改変していただいても、結構です。謝辞は必要ありませんが、レスポンスがあるとうれしいのは言うまでもありません(^^)。一応 zlib/libpng ライセンスとしておきますが、&o に被害が及ばない範囲でのパブリックドメインであると考えていただいて、差し支えありません。そのため、ライセンスは随時よりゆるいものへ変えていっています。おそらく、ある日突然厳しいライセンスを求めるものになったりはしないと思います。安心してお使いください。
法的には、上記の原文のほうが有効なので、より厳密には日本語訳よりも原文を参考にしてください。日本語訳は、http://opensource.jp/licenses/zlib-license.html から頂いてきました。
zlib/libpngライセンス ( 日本語訳 )
Copyright (c) 2004 &o
本ソフトウェアは「現状のまま」で、明示であるか暗黙であるかを問わず、何らの保証もなく提供されます。本ソフトウェアの使用によって生じるいかなる損害についても、作者は一切の責任を負わないものとします。 以下の制限に従う限り、商用アプリケーションを含めて、本ソフトウェアを任意の目的に使用し、自由に改変して再頒布することをすべての人に許可します。