From: <ag...@us...> - 2010-05-27 19:28:20
|
Revision: 1382 http://zoolib.svn.sourceforge.net/zoolib/?rev=1382&view=rev Author: agreen Date: 2010-05-27 19:28:12 +0000 (Thu, 27 May 2010) Log Message: ----------- Docs, and ValCondition-->ValPred. Modified Paths: -------------- trunk/zoolib/source/cxx/Doxyfile trunk/zoolib/source/cxx/default_config/zconfig.h trunk/zoolib/source/cxx/more/zoolib/zqe/ReadMe.txt trunk/zoolib/source/cxx/more/zoolib/zra/ReadMe.txt trunk/zoolib/source/cxx/zoolib/Docs_MainPage.txt trunk/zoolib/source/cxx/zoolib/Docs_NamingConvention.txt Added Paths: ----------- trunk/zoolib/source/cxx/zoolib/Docs_BuildingZooLib.txt trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValPred.h trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValPred_T.h trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValPred.cpp trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValPred.h trunk/zoolib/source/cxx/zoolib/ZValPred.h trunk/zoolib/source/cxx/zoolib/ZValPredCompound.cpp trunk/zoolib/source/cxx/zoolib/ZValPredCompound.h trunk/zoolib/source/cxx/zoolib/ZValPred_T.h trunk/zoolib/source/cxx/zoolib/ZVisitor_Expr_Logic_ValPred_DoEval_Matches_T.h trunk/zoolib/source/cxx/zoolib/ZVisitor_Expr_Logic_ValPred_DoGetNames_T.h trunk/zoolib/source/cxx/zoolib/ZVisitor_Expr_Logic_ValPred_DoToStrim.cpp trunk/zoolib/source/cxx/zoolib/ZVisitor_Expr_Logic_ValPred_DoToStrim.h Removed Paths: ------------- trunk/zoolib/source/cxx/more/zoolib/valbase/ZValBase_YadSeqRPos.cpp trunk/zoolib/source/cxx/more/zoolib/valbase/ZValBase_YadSeqRPos.h trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValCondition.h trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValCondition_T.h trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValCondition.cpp trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValCondition.h trunk/zoolib/source/cxx/zoolib/ZValCondition.h trunk/zoolib/source/cxx/zoolib/ZValCondition_T.h trunk/zoolib/source/cxx/zoolib/ZVisitor_Expr_Logic_ValCondition_DoEval_Matches_T.h trunk/zoolib/source/cxx/zoolib/ZVisitor_Expr_Logic_ValCondition_DoGetNames_T.h trunk/zoolib/source/cxx/zoolib/ZVisitor_Expr_Logic_ValCondition_DoToStrim.cpp trunk/zoolib/source/cxx/zoolib/ZVisitor_Expr_Logic_ValCondition_DoToStrim.h Modified: trunk/zoolib/source/cxx/Doxyfile =================================================================== --- trunk/zoolib/source/cxx/Doxyfile 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/Doxyfile 2010-05-27 19:28:12 UTC (rev 1382) @@ -31,7 +31,7 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.9 +##PROJECT_NUMBER = 0.9 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -105,7 +105,7 @@ # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. -FULL_PATH_NAMES = NO +FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is @@ -314,7 +314,8 @@ # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. -EXTRACT_LOCAL_CLASSES = YES +### +EXTRACT_LOCAL_CLASSES = NO # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in @@ -337,14 +338,16 @@ # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. -HIDE_UNDOC_MEMBERS = YES +###HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. -HIDE_UNDOC_CLASSES = YES +###HIDE_UNDOC_CLASSES = YES +HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. @@ -414,7 +417,8 @@ # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. -SORT_GROUP_NAMES = NO +###SORT_GROUP_NAMES = NO +SORT_GROUP_NAMES = YES # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to @@ -442,7 +446,8 @@ # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. -GENERATE_BUGLIST = YES +###GENERATE_BUGLIST = YES +GENERATE_BUGLIST = NO # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting @@ -475,7 +480,8 @@ # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. -SHOW_DIRECTORIES = NO +###SHOW_DIRECTORIES = NO +SHOW_DIRECTORIES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the @@ -570,8 +576,19 @@ # with spaces. INPUT = \ + ./zoolib/ \ + ./more/zoolib/blackberry/ \ + ./more/zoolib/sqlite/ \ ./more/zoolib/zqe/ \ - ./more/zoolib/zql/ \ + ./more/zoolib/zra/ \ + + +INPUTDIS3 = \ + ./more/zoolib/photoshop/ \ + ./more/zoolib/sqlite/ \ + ./more/zoolib/tuplebase/ \ + ./more/zoolib/zqe/ \ + ./more/zoolib/zra/ \ ./zoolib/ \ INPUT_DIS2 = DoxygenMainPage.txt \ @@ -757,20 +774,23 @@ # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. -ALPHABETICAL_INDEX = NO +###ALPHABETICAL_INDEX = NO +ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) -COLS_IN_ALPHA_INDEX = 5 +###COLS_IN_ALPHA_INDEX = 5 +COLS_IN_ALPHA_INDEX = 3 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. -IGNORE_PREFIX = +###IGNORE_PREFIX = +IGNORE_PREFIX = Z #--------------------------------------------------------------------------- # configuration options related to the HTML output @@ -826,7 +846,8 @@ # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). -HTML_DYNAMIC_SECTIONS = NO +###HTML_DYNAMIC_SECTIONS = NO +HTML_DYNAMIC_SECTIONS = YES # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 @@ -838,21 +859,22 @@ # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. -GENERATE_DOCSET = NO +###GENERATE_DOCSET = NO +GENERATE_DOCSET = YES # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. -DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_FEEDNAME = "ZooLib" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. -DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_BUNDLE_ID = org.zoolib # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the Modified: trunk/zoolib/source/cxx/default_config/zconfig.h =================================================================== --- trunk/zoolib/source/cxx/default_config/zconfig.h 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/default_config/zconfig.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -22,6 +22,10 @@ #define __zconfig__ 1 #include "zoolib/zconfigd.h" + +// For projects that need special settings, copy this file to a location that will be found +// first by your compiler and put any settings here -- after zconfid.h, and before zconfigl.h. + #include "zoolib/zconfigl.h" #endif // __zconfig__ Deleted: trunk/zoolib/source/cxx/more/zoolib/valbase/ZValBase_YadSeqRPos.cpp =================================================================== --- trunk/zoolib/source/cxx/more/zoolib/valbase/ZValBase_YadSeqRPos.cpp 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/more/zoolib/valbase/ZValBase_YadSeqRPos.cpp 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,101 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- -Copyright (c) 2010 Andrew Green -http://www.zoolib.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------------------------- */ - -#include "zoolib/ZYad_Any.h" -#include "zoolib/valbase/ZValBase.h" -#include "zoolib/valbase/ZValBase_YadSeqRPos.h" -#include "zoolib/zqe/ZQE_Result_Any.h" -#include "zoolib/zra/ZRA_Expr_Rel_Concrete.h" - -NAMESPACE_ZOOLIB_BEGIN -namespace ZValBase_YadSeqRPos { - -// ================================================================================================= -#pragma mark - -#pragma mark * Iterator - -class Iterator : public ZQE::Iterator - { -public: - Iterator(ZRef<ZYadSeqRPos> iYadSeqRPos); - virtual ~Iterator(); - - virtual ZRef<ZQE::Iterator> Clone(); - virtual ZRef<ZQE::Result> ReadInc(); - -protected: - ZRef<ZYadSeqRPos> fYadSeqRPos; - }; - -Iterator::Iterator(ZRef<ZYadSeqRPos> iYadSeqRPos) -: fYadSeqRPos(iYadSeqRPos) - {} - -Iterator::~Iterator() - {} - -ZRef<ZQE::Iterator> Iterator::Clone() - { return new Iterator(fYadSeqRPos->Clone()); } - -ZRef<ZQE::Result> Iterator::ReadInc() - { - if (ZRef<ZYadR> theYadR = fYadSeqRPos->ReadInc()) - return new ZQE::Result_Any(sFromYadR(ZVal_Any(), theYadR)); - return ZRef<ZQE::Result>(); - } - -// ================================================================================================= -#pragma mark - -#pragma mark * Expr_Rel_Concrete - -class Expr_Rel_Concrete : public ZValBase::Expr_Rel_Concrete - { -public: - Expr_Rel_Concrete(ZRef<ZYadSeqRPos> iYadSeqRPos); - -// From ZRA::Expr_Rel_Concrete via ZValBase::Expr_Rel_Concrete - virtual ZRA::RelHead GetRelHead(); - -// From ZValBase::Expr_Rel_Concrete - virtual ZRef<ZQE::Iterator> MakeIterator(); - -private: - ZRef<ZYadSeqRPos> fYadSeqRPos; - }; - -Expr_Rel_Concrete::Expr_Rel_Concrete(ZRef<ZYadSeqRPos> iYadSeqRPos) -: fYadSeqRPos(iYadSeqRPos) - {} - -ZRA::RelHead Expr_Rel_Concrete::GetRelHead() - { return ZRA::RelHead::sUniversal(); } - -ZRef<ZQE::Iterator> Expr_Rel_Concrete::MakeIterator() - { return new Iterator(fYadSeqRPos); } - -// ================================================================================================= -#pragma mark - -#pragma mark * ZValBase_YadSeqRPos pseudo constructors - -ZRef<ZRA::Expr_Rel> sConcrete(ZRef<ZYadSeqRPos> iYadSeqRPos) - { return new Expr_Rel_Concrete(iYadSeqRPos); } - -} // namespace ZValBase_YadSeqRPos -NAMESPACE_ZOOLIB_END Deleted: trunk/zoolib/source/cxx/more/zoolib/valbase/ZValBase_YadSeqRPos.h =================================================================== --- trunk/zoolib/source/cxx/more/zoolib/valbase/ZValBase_YadSeqRPos.h 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/more/zoolib/valbase/ZValBase_YadSeqRPos.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,40 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- -Copyright (c) 2010 Andrew Green -http://www.zoolib.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------------------------- */ - -#ifndef __ZValBase_YadSeqRPos__ -#define __ZValBase_YadSeqRPos__ 1 -#include "zconfig.h" - -#include "zoolib/ZYad.h" -#include "zoolib/zra/ZRA_Expr_Rel.h" - -NAMESPACE_ZOOLIB_BEGIN -namespace ZValBase_YadSeqRPos { - -// ================================================================================================= -#pragma mark - -#pragma mark * ZValBase_YadSeqRPos pseudo constructors - -ZRef<ZRA::Expr_Rel> sConcrete(ZRef<ZYadSeqRPos> iYadSeqRPos); - -} // namespace ZValBase_YadSeqRPos -NAMESPACE_ZOOLIB_END - -#endif // __ZValBase_YadSeqRPos__ Modified: trunk/zoolib/source/cxx/more/zoolib/zqe/ReadMe.txt =================================================================== --- trunk/zoolib/source/cxx/more/zoolib/zqe/ReadMe.txt 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/more/zoolib/zqe/ReadMe.txt 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,4 +1,6 @@ /** \defgroup ZQE +The ZQE namespace contains facilities for building a Query Engine, code that can walk data sources to implement relational semantics. + */ Modified: trunk/zoolib/source/cxx/more/zoolib/zra/ReadMe.txt =================================================================== --- trunk/zoolib/source/cxx/more/zoolib/zra/ReadMe.txt 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/more/zoolib/zra/ReadMe.txt 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,4 +1,6 @@ /** \defgroup ZRA +The ZRA namespace contains a suite of Relational Algebra expression nodes, and functions and operators for combining them. + */ Added: trunk/zoolib/source/cxx/zoolib/Docs_BuildingZooLib.txt =================================================================== --- trunk/zoolib/source/cxx/zoolib/Docs_BuildingZooLib.txt (rev 0) +++ trunk/zoolib/source/cxx/zoolib/Docs_BuildingZooLib.txt 2010-05-27 19:28:12 UTC (rev 1382) @@ -0,0 +1,24 @@ +/** +\defgroup BuildingZooLib Building ZooLib + +ZooLib is not a monolithic framework. It's more like a kit, something from which you draw pieces as you need them. So we tend not to build it as a standalone library or dll, instead we simply incorporate the source files we need for the task at hand. + +Generally any ZooLib source file can be included in any project, regardless of compiler or operating system. Code that depends on a compiler or OS facility is conditionally compiled and simply drops out if it's not usable. The file ZCONFIG_SPI.h uses compiler and environment-provided macro definitions to set up SPI (Service Provider Interface) macros that indicate whether a feature is available or not. Some of the SPI macros are quite broad e.g. Are we building for Mac OS X? Are we building for Windows?. Most are more specific e.g. Is CoreFoundation available? Is pthreads available? + +SPI features are marked with two macros. For example the pthread macros are ZCONFIG_SPI_Avail__pthread and ZCONFIG_SPI_Desired__pthread. If the Avail macro evaluates true it indicates that the feature is available. If the Desired macro evaluates true, it indicates that the project would like to use the feature. You test for availability and desirability with the macro ZCONFIG_SPI_Enabled(pthread). By default all features are marked as desired, and are marked as available if we can be sure they are available. So you can force use of a feature by setting ZCONFIG_SPI_Avail__XXX true, and force non-use by setting ZCONFIG_SPI_Desired__XXX false. + +Every ZooLib header file starts with +\code +#include "zconfig.h" +\endcode +There is a default copy of this file in \c zoolib/default_config. If you wish to provide project-specific settings, create your own \c zconfig.h file and make sure it's found before the default one. The simplest way to do that is to put it in with your own source files, and to make sure that \c zoolib/default_config is not in your project's include paths. + +To use ZooLib in your own project: +- Put the ZooLib directory somewhere stable. +- In your project, add the \c zoolib/source/zoolib/cxx directory to your header search paths. +- If you \e don't need to make any configuration changes, add \c zoolib/source/zoolib/cxx/default_config to your header search paths. +- If you want to use any features from the more directory, add \c zoolib/source/zoolib/cxx/more to your header search paths. +- Add to your project whichever ZooLib cpp/mm files you need. + +You can see sample projects in \c zoolib_samples, a sibling of the top-level zoolib directory. +*/ Modified: trunk/zoolib/source/cxx/zoolib/Docs_MainPage.txt =================================================================== --- trunk/zoolib/source/cxx/zoolib/Docs_MainPage.txt 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/zoolib/Docs_MainPage.txt 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,4 +1,63 @@ /** \mainpage -Some words for the main page + +ZooLib is a C++ library that I've been developing and using since 1992, and which has been open source since 2000. + +As it's under active development you may want to subscribe to the zoolib-checkins mailing list at <https://lists.sourceforge.net/lists/listinfo/zoolib-checkins>. + +It has several purposes: +- To extend the longevity of code I write, by providing some isolation from the inevitable compiler, library and operating system differences and changes. +- To provide simpler APIs for common tasks and to isolate workarounds. +- To be a repository of useful building blocks. + +So its content is somewhat eclectic, but can be considered as falling into four groups: +- OS abstractions +- ZooLib abstractions +- Higher level facilities +- API and product-specific facilities + +\section MainOSAbstractions OS Abstractions +Yep, another suite of OS wrappers, sorry. In my defense in 2010 we've only just witnessed the standardization of a portable thread API, and still don't have standard networking or file system APIs. You don't have to learn ZooLib's OS abstractions, and obviously you don't have to use them in your own code. But they're pretty robust and are there if you want. + +- \link Threads Threads\endlink +- \link Networking Networking\endlink +- \link Files Files\endlink + +\section MainZooLibAbstractions ZooLib Abstractions +- Byte streams +- String streams +- Unicode and text encodings +- Variant types +- Structured data parsing and generation +- Work and task management +- Reference counting + +\subsection MainByteAndStringStreams Byte and String Streams +ZooLib makes an explicit distinction between a \link Stream byte stream \endlink and a \link Strim string stream \endlink (a \em strim in our parlance). The former is just what you'd expect -- an entity to which you can write (or from which you can read) bytes. With the latter you write or read unicode strings (and in the limit, single unicode code points). + +\subsection MainUnicodeAndTextEncodings Unicode and Text Encodings +ZooLib provides platform-appropriate typedefs for UTF8, UTF16 and UTF32 code units, and string8, string16 and string32 (basic_string parameterized on those types.) There's a complete suite of 8<-->16<-->32<-->8 conversion functions that work with raw buffers, strings and iterators. String streams take and return strings using whichever serialization is most convenient for your code, regardless of the underlying encoding. + +\subsection MainVariantTypes Variant Types +Variants are a fairly new addition to ZooLIb. Variants like OSX's CFTypeRef show up all over the place but have wildly differing APIs. ZooLib has a standard API for working with variants, such that you can often change a typedef or parametrize a template on a different variant type without changing code. If nothing else they mean you don't have to remember multiple APIs. + +\subsection MainStructuredData Structured Data Parsing and Generation +XML of one sort and another, JSON, in-memory variant types, the windows registry, AppleEvents and similar RPC representations can all be worked with using the ZYadR suite. + +\section MainHigherLevelFacilities Higher Level Facilities +- Wide variety of streams and strims +- Generic Pixmap +- Pixmap codecs + +\section MainAPIFacilities API and Product-Specific Facilities +- \link BlackBerry BlackBerry\endlink +- Javascriptcore bindings +- Netscape plugins +- Photoshop +- Sqlite +- Tuplebase and tuplesoup +- \link ZRA Relational algebra\endlink +- \link ZQE Relational query executor\endlink +- Dataspace + */ Modified: trunk/zoolib/source/cxx/zoolib/Docs_NamingConvention.txt =================================================================== --- trunk/zoolib/source/cxx/zoolib/Docs_NamingConvention.txt 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/zoolib/Docs_NamingConvention.txt 2010-05-27 19:28:12 UTC (rev 1382) @@ -51,8 +51,8 @@ Classes and method names have an upper case initial letter. -Local variables have a lower case initial letter. I often use a \c the prefix, but the really -just whatever reads best. +Local variables have a lower case initial letter. I often use a \c the prefix, but the +goal is just to make it read well. Pretty much everything else has a scope prefix. Deleted: trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValCondition.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValCondition.h 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValCondition.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,52 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- -Copyright (c) 2010 Andrew Green -http://www.zoolib.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------------------------- */ - -#ifndef __ZExpr_Logic_ValCondition__ -#define __ZExpr_Logic_ValCondition__ 1 -#include "zconfig.h" - -#include "zoolib/ZExpr_Logic_ValCondition_T.h" -#include "zoolib/ZValCondition.h" -#include "zoolib/ZVisitor_Expr_Logic_ValCondition_DoEval_Matches_T.h" -#include "zoolib/ZVisitor_Expr_Logic_ValCondition_DoGetNames_T.h" - -NAMESPACE_ZOOLIB_BEGIN - -// ================================================================================================= -#pragma mark - -#pragma mark * ZExpr_Logic_ValCondition - -typedef ZExpr_Logic_ValCondition_T<ZVal_Expr> ZExpr_Logic_ValCondition; - -typedef ZVisitor_Expr_Logic_ValCondition_T<ZVal_Expr> ZVisitor_Expr_Logic_ValCondition; - - -inline std::set<std::string> sGetNames(const ZRef<ZExpr_Logic>& iExpr) - { return ZVisitor_Expr_Logic_ValCondition_DoGetNames_T<ZVal_Expr>().Do(iExpr); } - -inline bool sMatches(const ZRef<ZExpr_Logic>& iExpr, const ZVal_Expr& iVal) - { return ZVisitor_Expr_Logic_ValCondition_DoEval_Matches_T<ZVal_Expr>(iVal).Do(iExpr); } - -inline bool sMatches(const ZValCondition& iValCondition, const ZVal_Expr& iVal) - { return sMatches(new ZExpr_Logic_ValCondition(iValCondition), iVal); } - -NAMESPACE_ZOOLIB_END - -#endif // __ZExpr_Logic_ValCondition__ Deleted: trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValCondition_T.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValCondition_T.h 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValCondition_T.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,213 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- -Copyright (c) 2010 Andrew Green -http://www.zoolib.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------------------------- */ - -#ifndef __ZExpr_Logic_ValCondition_T__ -#define __ZExpr_Logic_ValCondition_T__ 1 -#include "zconfig.h" - -#include "zoolib/ZExpr_Logic.h" -#include "zoolib/ZValCondition_T.h" - -NAMESPACE_ZOOLIB_BEGIN - -template <class Val> class ZVisitor_Expr_Logic_ValCondition_T; - -// ================================================================================================= -#pragma mark - -#pragma mark * ZExpr_Logic_ValCondition_T - -template <class Val> -class ZExpr_Logic_ValCondition_T -: public virtual ZExpr_Logic -, public virtual ZExpr_Op0_T<ZExpr_Logic> - { - typedef ZExpr_Op0_T<ZExpr_Logic> inherited; -public: - ZExpr_Logic_ValCondition_T(const ZValCondition_T<Val>& iCondition); - virtual ~ZExpr_Logic_ValCondition_T(); - -// From ZExpr_Op0 - virtual void Accept_Expr_Op0(ZVisitor_Expr_Op0_T<ZExpr_Logic>& iVisitor); - - virtual ZRef<ZExpr_Logic> Self(); - virtual ZRef<ZExpr_Logic> Clone(); - -// Our protocol - virtual void Accept_Expr_Logic_ValCondition(ZVisitor_Expr_Logic_ValCondition_T<Val>& iVisitor); - - const ZValCondition_T<Val>& GetValCondition(); - -private: - const ZValCondition_T<Val> fValCondition; - }; - -template <class Val> -ZExpr_Logic_ValCondition_T<Val>::ZExpr_Logic_ValCondition_T( - const ZValCondition_T<Val>& iValCondition) -: fValCondition(iValCondition) - {} - -template <class Val> -ZExpr_Logic_ValCondition_T<Val>::~ZExpr_Logic_ValCondition_T() - {} - -template <class Val> -void ZExpr_Logic_ValCondition_T<Val>::Accept_Expr_Op0(ZVisitor_Expr_Op0_T<ZExpr_Logic>& iVisitor) - { - if (ZVisitor_Expr_Logic_ValCondition_T<Val>* theVisitor = - dynamic_cast<ZVisitor_Expr_Logic_ValCondition_T<Val>*>(&iVisitor)) - { - this->Accept_Expr_Logic_ValCondition(*theVisitor); - } - else - { - inherited::Accept_Expr_Op0(iVisitor); - } - } - -template <class Val> -ZRef<ZExpr_Logic> ZExpr_Logic_ValCondition_T<Val>::Self() - { return this; } - -template <class Val> -ZRef<ZExpr_Logic> ZExpr_Logic_ValCondition_T<Val>::Clone() - { return this; } - -template <class Val> -void ZExpr_Logic_ValCondition_T<Val>::Accept_Expr_Logic_ValCondition( - ZVisitor_Expr_Logic_ValCondition_T<Val>& iVisitor) - { iVisitor.Visit_Expr_Logic_ValCondition(this); } - -template <class Val> -const ZValCondition_T<Val>& -ZExpr_Logic_ValCondition_T<Val>::GetValCondition() - { return fValCondition; } - -// ================================================================================================= -#pragma mark - -#pragma mark * ZVisitor_Expr_Logic_ValCondition_T - -template <class Val> -class ZVisitor_Expr_Logic_ValCondition_T -: public virtual ZVisitor_Expr_Op0_T<ZExpr_Logic> - { - typedef ZVisitor_Expr_Op0_T<ZExpr_Logic> inherited; -public: - virtual void Visit_Expr_Logic_ValCondition(ZRef<ZExpr_Logic_ValCondition_T<Val> > iExpr); - }; - -template <class Val> -void ZVisitor_Expr_Logic_ValCondition_T<Val>::Visit_Expr_Logic_ValCondition( - ZRef<ZExpr_Logic_ValCondition_T<Val> > iExpr) - { this->Visit_Expr_Op0(iExpr); } - -// ================================================================================================= -#pragma mark - -#pragma mark * Operators - -template <class Val> -ZRef<ZExpr_Logic> sLogic(const ZValCondition_T<Val>& iValCondition) - { return new ZExpr_Logic_ValCondition_T<Val>(iValCondition); } - -template <class Val> -ZRef<ZExpr_Logic_Not> operator~(const ZValCondition_T<Val>& iValCondition) - { return new ZExpr_Logic_Not(new ZExpr_Logic_ValCondition_T<Val>(iValCondition)); } - -template <class Val> -ZRef<ZExpr_Logic> operator&(bool iBool, const ZValCondition_T<Val>& iValCondition) - { - if (iBool) - return new ZExpr_Logic_ValCondition_T<Val>(iValCondition); - return new ZExpr_Logic_False; - } - -template <class Val> -ZRef<ZExpr_Logic> operator&(const ZValCondition_T<Val>& iValCondition, bool iBool) - { - if (iBool) - return new ZExpr_Logic_ValCondition_T<Val>(iValCondition); - return new ZExpr_Logic_False; - } - -template <class Val> -ZRef<ZExpr_Logic> operator|(bool iBool, const ZValCondition_T<Val>& iValCondition) - { - if (iBool) - return new ZExpr_Logic_True; - return new ZExpr_Logic_ValCondition_T<Val>(iValCondition); - } - -template <class Val> -ZRef<ZExpr_Logic> operator|(const ZValCondition_T<Val>& iValCondition, bool iBool) - { - if (iBool) - return new ZExpr_Logic_True; - return new ZExpr_Logic_ValCondition_T<Val>(iValCondition); - } - -template <class Val> -ZRef<ZExpr_Logic> operator&(const ZValCondition_T<Val>& iLHS, const ZValCondition_T<Val>& iRHS) - { - return new ZExpr_Logic_And( - new ZExpr_Logic_ValCondition_T<Val>(iLHS), - new ZExpr_Logic_ValCondition_T<Val>(iRHS)); - } - -template <class Val> -ZRef<ZExpr_Logic> operator&(const ZValCondition_T<Val>& iLHS, const ZRef<ZExpr_Logic>& iRHS) - { return new ZExpr_Logic_And(new ZExpr_Logic_ValCondition_T<Val>(iLHS), iRHS); } - -template <class Val> -ZRef<ZExpr_Logic> operator&(const ZRef<ZExpr_Logic>& iLHS, const ZValCondition_T<Val>& iRHS) - { return new ZExpr_Logic_And(new ZExpr_Logic_ValCondition_T<Val>(iRHS), iLHS); } - -template <class Val> -ZRef<ZExpr_Logic>& operator&=(ZRef<ZExpr_Logic>& ioLHS, const ZValCondition_T<Val>& iRHS) - { - ioLHS = ioLHS & iRHS; - return ioLHS; - } - -template <class Val> -ZRef<ZExpr_Logic> operator|(const ZValCondition_T<Val>& iLHS, const ZValCondition_T<Val>& iRHS) - { - return new ZExpr_Logic_Or( - new ZExpr_Logic_ValCondition_T<Val>(iLHS), - new ZExpr_Logic_ValCondition_T<Val>(iRHS)); - } - -template <class Val> -ZRef<ZExpr_Logic> operator|(const ZValCondition_T<Val>& iLHS, const ZRef<ZExpr_Logic>& iRHS) - { return new ZExpr_Logic_Or(new ZExpr_Logic_ValCondition_T<Val>(iLHS), iRHS); } - -template <class Val> -ZRef<ZExpr_Logic> operator|(const ZRef<ZExpr_Logic>& iLHS, const ZValCondition_T<Val>& iRHS) - { return new ZExpr_Logic_Or(new ZExpr_Logic_ValCondition_T<Val>(iRHS), iLHS); } - -template <class Val> -ZRef<ZExpr_Logic>& operator|=(ZRef<ZExpr_Logic>& ioLHS, const ZValCondition_T<Val>& iRHS) - { - ioLHS = ioLHS | iRHS; - return ioLHS; - } - -NAMESPACE_ZOOLIB_END - -#endif // __ZExpr_Logic_ValCondition_T__ Added: trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValPred.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValPred.h (rev 0) +++ trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValPred.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -0,0 +1,52 @@ +/* ------------------------------------------------------------------------------------------------- +Copyright (c) 2010 Andrew Green +http://www.zoolib.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------------------------- */ + +#ifndef __ZExpr_Logic_ValPred__ +#define __ZExpr_Logic_ValPred__ 1 +#include "zconfig.h" + +#include "zoolib/ZExpr_Logic_ValPred_T.h" +#include "zoolib/ZValPred.h" +#include "zoolib/ZVisitor_Expr_Logic_ValPred_DoEval_Matches_T.h" +#include "zoolib/ZVisitor_Expr_Logic_ValPred_DoGetNames_T.h" + +NAMESPACE_ZOOLIB_BEGIN + +// ================================================================================================= +#pragma mark - +#pragma mark * ZExpr_Logic_ValPred + +typedef ZExpr_Logic_ValPred_T<ZVal_Expr> ZExpr_Logic_ValPred; + +typedef ZVisitor_Expr_Logic_ValPred_T<ZVal_Expr> ZVisitor_Expr_Logic_ValPred; + + +inline std::set<std::string> sGetNames(const ZRef<ZExpr_Logic>& iExpr) + { return ZVisitor_Expr_Logic_ValPred_DoGetNames_T<ZVal_Expr>().Do(iExpr); } + +inline bool sMatches(const ZRef<ZExpr_Logic>& iExpr, const ZVal_Expr& iVal) + { return ZVisitor_Expr_Logic_ValPred_DoEval_Matches_T<ZVal_Expr>(iVal).Do(iExpr); } + +inline bool sMatches(const ZValPred& iValPred, const ZVal_Expr& iVal) + { return sMatches(new ZExpr_Logic_ValPred(iValPred), iVal); } + +NAMESPACE_ZOOLIB_END + +#endif // __ZExpr_Logic_ValPred__ Added: trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValPred_T.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValPred_T.h (rev 0) +++ trunk/zoolib/source/cxx/zoolib/ZExpr_Logic_ValPred_T.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -0,0 +1,213 @@ +/* ------------------------------------------------------------------------------------------------- +Copyright (c) 2010 Andrew Green +http://www.zoolib.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------------------------- */ + +#ifndef __ZExpr_Logic_ValPred_T__ +#define __ZExpr_Logic_ValPred_T__ 1 +#include "zconfig.h" + +#include "zoolib/ZExpr_Logic.h" +#include "zoolib/ZValPred_T.h" + +NAMESPACE_ZOOLIB_BEGIN + +template <class Val> class ZVisitor_Expr_Logic_ValPred_T; + +// ================================================================================================= +#pragma mark - +#pragma mark * ZExpr_Logic_ValPred_T + +template <class Val> +class ZExpr_Logic_ValPred_T +: public virtual ZExpr_Logic +, public virtual ZExpr_Op0_T<ZExpr_Logic> + { + typedef ZExpr_Op0_T<ZExpr_Logic> inherited; +public: + ZExpr_Logic_ValPred_T(const ZValPred_T<Val>& iCondition); + virtual ~ZExpr_Logic_ValPred_T(); + +// From ZExpr_Op0 + virtual void Accept_Expr_Op0(ZVisitor_Expr_Op0_T<ZExpr_Logic>& iVisitor); + + virtual ZRef<ZExpr_Logic> Self(); + virtual ZRef<ZExpr_Logic> Clone(); + +// Our protocol + virtual void Accept_Expr_Logic_ValPred(ZVisitor_Expr_Logic_ValPred_T<Val>& iVisitor); + + const ZValPred_T<Val>& GetValPred(); + +private: + const ZValPred_T<Val> fValPred; + }; + +template <class Val> +ZExpr_Logic_ValPred_T<Val>::ZExpr_Logic_ValPred_T( + const ZValPred_T<Val>& iValPred) +: fValPred(iValPred) + {} + +template <class Val> +ZExpr_Logic_ValPred_T<Val>::~ZExpr_Logic_ValPred_T() + {} + +template <class Val> +void ZExpr_Logic_ValPred_T<Val>::Accept_Expr_Op0(ZVisitor_Expr_Op0_T<ZExpr_Logic>& iVisitor) + { + if (ZVisitor_Expr_Logic_ValPred_T<Val>* theVisitor = + dynamic_cast<ZVisitor_Expr_Logic_ValPred_T<Val>*>(&iVisitor)) + { + this->Accept_Expr_Logic_ValPred(*theVisitor); + } + else + { + inherited::Accept_Expr_Op0(iVisitor); + } + } + +template <class Val> +ZRef<ZExpr_Logic> ZExpr_Logic_ValPred_T<Val>::Self() + { return this; } + +template <class Val> +ZRef<ZExpr_Logic> ZExpr_Logic_ValPred_T<Val>::Clone() + { return this; } + +template <class Val> +void ZExpr_Logic_ValPred_T<Val>::Accept_Expr_Logic_ValPred( + ZVisitor_Expr_Logic_ValPred_T<Val>& iVisitor) + { iVisitor.Visit_Expr_Logic_ValPred(this); } + +template <class Val> +const ZValPred_T<Val>& +ZExpr_Logic_ValPred_T<Val>::GetValPred() + { return fValPred; } + +// ================================================================================================= +#pragma mark - +#pragma mark * ZVisitor_Expr_Logic_ValPred_T + +template <class Val> +class ZVisitor_Expr_Logic_ValPred_T +: public virtual ZVisitor_Expr_Op0_T<ZExpr_Logic> + { + typedef ZVisitor_Expr_Op0_T<ZExpr_Logic> inherited; +public: + virtual void Visit_Expr_Logic_ValPred(ZRef<ZExpr_Logic_ValPred_T<Val> > iExpr); + }; + +template <class Val> +void ZVisitor_Expr_Logic_ValPred_T<Val>::Visit_Expr_Logic_ValPred( + ZRef<ZExpr_Logic_ValPred_T<Val> > iExpr) + { this->Visit_Expr_Op0(iExpr); } + +// ================================================================================================= +#pragma mark - +#pragma mark * Operators + +template <class Val> +ZRef<ZExpr_Logic> sLogic(const ZValPred_T<Val>& iValPred) + { return new ZExpr_Logic_ValPred_T<Val>(iValPred); } + +template <class Val> +ZRef<ZExpr_Logic_Not> operator~(const ZValPred_T<Val>& iValPred) + { return new ZExpr_Logic_Not(new ZExpr_Logic_ValPred_T<Val>(iValPred)); } + +template <class Val> +ZRef<ZExpr_Logic> operator&(bool iBool, const ZValPred_T<Val>& iValPred) + { + if (iBool) + return new ZExpr_Logic_ValPred_T<Val>(iValPred); + return new ZExpr_Logic_False; + } + +template <class Val> +ZRef<ZExpr_Logic> operator&(const ZValPred_T<Val>& iValPred, bool iBool) + { + if (iBool) + return new ZExpr_Logic_ValPred_T<Val>(iValPred); + return new ZExpr_Logic_False; + } + +template <class Val> +ZRef<ZExpr_Logic> operator|(bool iBool, const ZValPred_T<Val>& iValPred) + { + if (iBool) + return new ZExpr_Logic_True; + return new ZExpr_Logic_ValPred_T<Val>(iValPred); + } + +template <class Val> +ZRef<ZExpr_Logic> operator|(const ZValPred_T<Val>& iValPred, bool iBool) + { + if (iBool) + return new ZExpr_Logic_True; + return new ZExpr_Logic_ValPred_T<Val>(iValPred); + } + +template <class Val> +ZRef<ZExpr_Logic> operator&(const ZValPred_T<Val>& iLHS, const ZValPred_T<Val>& iRHS) + { + return new ZExpr_Logic_And( + new ZExpr_Logic_ValPred_T<Val>(iLHS), + new ZExpr_Logic_ValPred_T<Val>(iRHS)); + } + +template <class Val> +ZRef<ZExpr_Logic> operator&(const ZValPred_T<Val>& iLHS, const ZRef<ZExpr_Logic>& iRHS) + { return new ZExpr_Logic_And(new ZExpr_Logic_ValPred_T<Val>(iLHS), iRHS); } + +template <class Val> +ZRef<ZExpr_Logic> operator&(const ZRef<ZExpr_Logic>& iLHS, const ZValPred_T<Val>& iRHS) + { return new ZExpr_Logic_And(new ZExpr_Logic_ValPred_T<Val>(iRHS), iLHS); } + +template <class Val> +ZRef<ZExpr_Logic>& operator&=(ZRef<ZExpr_Logic>& ioLHS, const ZValPred_T<Val>& iRHS) + { + ioLHS = ioLHS & iRHS; + return ioLHS; + } + +template <class Val> +ZRef<ZExpr_Logic> operator|(const ZValPred_T<Val>& iLHS, const ZValPred_T<Val>& iRHS) + { + return new ZExpr_Logic_Or( + new ZExpr_Logic_ValPred_T<Val>(iLHS), + new ZExpr_Logic_ValPred_T<Val>(iRHS)); + } + +template <class Val> +ZRef<ZExpr_Logic> operator|(const ZValPred_T<Val>& iLHS, const ZRef<ZExpr_Logic>& iRHS) + { return new ZExpr_Logic_Or(new ZExpr_Logic_ValPred_T<Val>(iLHS), iRHS); } + +template <class Val> +ZRef<ZExpr_Logic> operator|(const ZRef<ZExpr_Logic>& iLHS, const ZValPred_T<Val>& iRHS) + { return new ZExpr_Logic_Or(new ZExpr_Logic_ValPred_T<Val>(iRHS), iLHS); } + +template <class Val> +ZRef<ZExpr_Logic>& operator|=(ZRef<ZExpr_Logic>& ioLHS, const ZValPred_T<Val>& iRHS) + { + ioLHS = ioLHS | iRHS; + return ioLHS; + } + +NAMESPACE_ZOOLIB_END + +#endif // __ZExpr_Logic_ValPred_T__ Deleted: trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValCondition.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValCondition.cpp 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValCondition.cpp 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,131 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- -Copyright (c) 2010 Andrew Green -http://www.zoolib.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------------------------- */ - -#include "zoolib/ZUtil_Strim_ValCondition.h" -#include "zoolib/ZYad_Any.h" -#include "zoolib/ZYad_ZooLibStrim.h" - -NAMESPACE_ZOOLIB_BEGIN - -namespace ZUtil_Strim_ValCondition { - -using std::string; - -typedef ZValComparator_Simple_T<ZVal_Expr> ZValComparator_Simple; -typedef ZValComparand_Trail_T<ZVal_Expr> ZValComparand_Trail; -typedef ZValComparand_Var_T<ZVal_Expr> ZValComparand_Var; -typedef ZValComparand_Const_T<ZVal_Expr> ZValComparand_Const; - -// ================================================================================================= -#pragma mark - -#pragma mark * Static helper functions - -static void spWrite_PropName(const string& iName, const ZStrimW& s) - { - s.Write("@"); - ZYad_ZooLibStrim::sWrite_PropName(iName, s); - } - -static void spToStrim(const ZRef<ZValCondition::ComparandRep>& iCR, const ZStrimW& s) - { - if (!iCR) - { - s << "!!Null Comparand!!"; - } - else if (ZRef<ZValComparand_Trail> cr = iCR.DynamicCast<ZValComparand_Trail>()) - { - const ZTrail& theTrail = cr->GetTrail(); - if (theTrail.Count() == 1) - spWrite_PropName(theTrail.At(0), s); - else - spWrite_PropName("/" + theTrail.AsString(), s); - } - else if (ZRef<ZValComparand_Var> cr = iCR.DynamicCast<ZValComparand_Var>()) - { - s << "$"; - ZYad_ZooLibStrim::sWrite_PropName(cr->GetVarName(), s); - } - else if (ZRef<ZValComparand_Const> cr = iCR.DynamicCast<ZValComparand_Const>()) - { - ZYad_ZooLibStrim::sToStrim(sMakeYadR(cr->GetVal()), s); - } - else - { - s << "!!Unknown Comparand!!"; - } - } - -static void spToStrim(const ZRef<ZValCondition::ComparatorRep>& iCR, const ZStrimW& s) - { - if (!iCR) - { - s << "!!Null Comparator!!"; - } - else if (ZRef<ZValComparator_Simple> cr = iCR.DynamicCast<ZValComparator_Simple>()) - { - switch (cr->GetEComparator()) - { - case ZValComparator_Simple::eLT: - { - s << " < "; - break; - } - case ZValComparator_Simple::eLE: - { - s << " <= "; - break; - } - case ZValComparator_Simple::eEQ: - { - s << " == "; - break; - } - case ZValComparator_Simple::eGE: - { - s << " >= "; - break; - } - case ZValComparator_Simple::eGT: - { - s << " > "; - break; - } - } - } - else - { - s << "!!Unknown Comparator!!"; - } - } - -// ================================================================================================= -#pragma mark - -#pragma mark * ZUtil_Strim_ValCondition - -void sToStrim(const ZValCondition& iValCondition, const ZStrimW& s) - { - spToStrim(iValCondition.GetLHS(), s); - spToStrim(iValCondition.GetComparator(), s); - spToStrim(iValCondition.GetRHS(), s); - } - -} // namespace ZUtil_Strim_ValCondition - -NAMESPACE_ZOOLIB_END Deleted: trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValCondition.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValCondition.h 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValCondition.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,42 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- -Copyright (c) 2010 Andrew Green -http://www.zoolib.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------------------------- */ - -#ifndef __ZUtil_Strim_ValCondition__ -#define __ZUtil_Strim_ValCondition__ -#include "zconfig.h" - -#include "zoolib/ZStrim.h" -#include "zoolib/ZValCondition.h" - -NAMESPACE_ZOOLIB_BEGIN - -namespace ZUtil_Strim_ValCondition { - -// ================================================================================================= -#pragma mark - -#pragma mark * ZUtil_Strim_ValCondition - -void sToStrim(const ZValCondition& iValCondition, const ZStrimW& iStrimW); - -} // namespace ZUtil_Strim_ValCondition - -NAMESPACE_ZOOLIB_END - -#endif // __ZUtil_Strim_ValCondition__ Added: trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValPred.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValPred.cpp (rev 0) +++ trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValPred.cpp 2010-05-27 19:28:12 UTC (rev 1382) @@ -0,0 +1,131 @@ +/* ------------------------------------------------------------------------------------------------- +Copyright (c) 2010 Andrew Green +http://www.zoolib.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------------------------- */ + +#include "zoolib/ZUtil_Strim_ValPred.h" +#include "zoolib/ZYad_Any.h" +#include "zoolib/ZYad_ZooLibStrim.h" + +NAMESPACE_ZOOLIB_BEGIN + +namespace ZUtil_Strim_ValPred { + +using std::string; + +typedef ZValComparator_Simple_T<ZVal_Expr> ZValComparator_Simple; +typedef ZValComparand_Trail_T<ZVal_Expr> ZValComparand_Trail; +typedef ZValComparand_Var_T<ZVal_Expr> ZValComparand_Var; +typedef ZValComparand_Const_T<ZVal_Expr> ZValComparand_Const; + +// ================================================================================================= +#pragma mark - +#pragma mark * Static helper functions + +static void spWrite_PropName(const string& iName, const ZStrimW& s) + { + s.Write("@"); + ZYad_ZooLibStrim::sWrite_PropName(iName, s); + } + +static void spToStrim(const ZRef<ZValPred::Comparand>& iCR, const ZStrimW& s) + { + if (!iCR) + { + s << "!!Null Comparand!!"; + } + else if (ZRef<ZValComparand_Trail> cr = iCR.DynamicCast<ZValComparand_Trail>()) + { + const ZTrail& theTrail = cr->GetTrail(); + if (theTrail.Count() == 1) + spWrite_PropName(theTrail.At(0), s); + else + spWrite_PropName("/" + theTrail.AsString(), s); + } + else if (ZRef<ZValComparand_Var> cr = iCR.DynamicCast<ZValComparand_Var>()) + { + s << "$"; + ZYad_ZooLibStrim::sWrite_PropName(cr->GetVarName(), s); + } + else if (ZRef<ZValComparand_Const> cr = iCR.DynamicCast<ZValComparand_Const>()) + { + ZYad_ZooLibStrim::sToStrim(sMakeYadR(cr->GetVal()), s); + } + else + { + s << "!!Unknown Comparand!!"; + } + } + +static void spToStrim(const ZRef<ZValPred::Comparator>& iCR, const ZStrimW& s) + { + if (!iCR) + { + s << "!!Null Comparator!!"; + } + else if (ZRef<ZValComparator_Simple> cr = iCR.DynamicCast<ZValComparator_Simple>()) + { + switch (cr->GetEComparator()) + { + case ZValComparator_Simple::eLT: + { + s << " < "; + break; + } + case ZValComparator_Simple::eLE: + { + s << " <= "; + break; + } + case ZValComparator_Simple::eEQ: + { + s << " == "; + break; + } + case ZValComparator_Simple::eGE: + { + s << " >= "; + break; + } + case ZValComparator_Simple::eGT: + { + s << " > "; + break; + } + } + } + else + { + s << "!!Unknown Comparator!!"; + } + } + +// ================================================================================================= +#pragma mark - +#pragma mark * ZUtil_Strim_ValPred + +void sToStrim(const ZValPred& iValPred, const ZStrimW& s) + { + spToStrim(iValPred.GetLHS(), s); + spToStrim(iValPred.GetComparator(), s); + spToStrim(iValPred.GetRHS(), s); + } + +} // namespace ZUtil_Strim_ValPred + +NAMESPACE_ZOOLIB_END Added: trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValPred.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValPred.h (rev 0) +++ trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_ValPred.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -0,0 +1,42 @@ +/* ------------------------------------------------------------------------------------------------- +Copyright (c) 2010 Andrew Green +http://www.zoolib.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------------------------- */ + +#ifndef __ZUtil_Strim_ValPred__ +#define __ZUtil_Strim_ValPred__ +#include "zconfig.h" + +#include "zoolib/ZStrim.h" +#include "zoolib/ZValPred.h" + +NAMESPACE_ZOOLIB_BEGIN + +namespace ZUtil_Strim_ValPred { + +// ================================================================================================= +#pragma mark - +#pragma mark * ZUtil_Strim_ValPred + +void sToStrim(const ZValPred& iValPred, const ZStrimW& iStrimW); + +} // namespace ZUtil_Strim_ValPred + +NAMESPACE_ZOOLIB_END + +#endif // __ZUtil_Strim_ValPred__ Deleted: trunk/zoolib/source/cxx/zoolib/ZValCondition.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZValCondition.h 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/zoolib/ZValCondition.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,67 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- -Copyright (c) 2010 Andrew Green -http://www.zoolib.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------------------------- */ - -#ifndef __ZValCondition__ -#define __ZValCondition__ 1 -#include "zconfig.h" - -#include "zoolib/ZValCondition_T.h" - -#include "zoolib/ZVal_Any.h" -//#include "zoolib/ZVal_CFType.h" -//#include "zoolib/ZVal_Zoolib.h" - -NAMESPACE_ZOOLIB_BEGIN - -typedef ZMap_Any ZMap_Expr; - -//typedef ZMap_CFType ZMap_Expr; -//typedef ZMap_ZooLib ZMap_Expr; - -typedef ZMap_Expr::Val_t ZVal_Expr; - -// ================================================================================================= -#pragma mark - -#pragma mark * ZValCondition - -typedef ZValCondition_T<ZVal_Expr> ZValCondition; -typedef ZValComparandPseudo_T<ZVal_Expr> ZValComparandPseudo; - -inline ZValComparandPseudo CString(const std::string& iVal) - { return CConst_T<ZVal_Expr>(string8(iVal)); } - -inline ZValComparandPseudo CConst(const ZVal_Expr& iVal) - { return CConst_T<ZVal_Expr>(iVal); } - -inline ZValComparandPseudo CName(const std::string& iName) - { return CName_T<ZVal_Expr>(iName); } - -inline ZValComparandPseudo CTrail(const ZTrail& iTrail) - { return CTrail_T<ZVal_Expr>(iTrail); } - -inline ZValComparandPseudo CVal() - { return CVal_T<ZVal_Expr>(); } - -inline ZValComparandPseudo CVar(const std::string& iVarName) - { return CVar_T<ZVal_Expr>(iVarName); } - -NAMESPACE_ZOOLIB_END - -#endif // __ZValCondition__ Deleted: trunk/zoolib/source/cxx/zoolib/ZValCondition_T.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZValCondition_T.h 2010-05-27 19:27:02 UTC (rev 1381) +++ trunk/zoolib/source/cxx/zoolib/ZValCondition_T.h 2010-05-27 19:28:12 UTC (rev 1382) @@ -1,557 +0,0 @@ -/* --------------------------------... [truncated message content] |