foundationkit.h
来自「这是VCF框架的代码」· C头文件 代码 · 共 342 行
H
342 行
#ifndef _VCF_FOUNDATIONKIT_H__#define _VCF_FOUNDATIONKIT_H__//FoundationKit.h/*Copyright 2000-2004 The VCF Project.Please see License.txt in the top level directorywhere you installed the VCF.*/#if _MSC_VER > 1000# pragma once#endif#ifdef _MSC_VER//disable warnings on 255 char debug symbols #pragma warning (disable : 4786)//disable warnings on extern before template instantiation #pragma warning (disable : 4231) #pragma warning (disable : 4251) #pragma warning (disable : 4275)#endif//#include <iostream>#include <typeinfo>#include <algorithm>#include <math.h>#ifdef VCF_GCC//#include <varargs.h>#include <stdarg.h>#endif //VCF_GCC#ifdef macintosh #include <string.h> #include <extras.h>#endif#ifdef __BORLANDC__ #include <string.h>#endif#ifdef WIN32 #include <process.h>#endif#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <time.h>#ifndef __MWERKS__ #include <memory.h>#else #include <wchar.h> #include <wctype.h> #ifdef VCF_CW_W32 #include <memory> #elif defined(VCF_CW_OSX) #include <memory.h> #endif#endif //__MWERKS__//#include <assert.h>#include <vector>#include <map>#include <string>#include <bitset>#include <exception>#include <list>//#include "vcf/FoundationKit/VCF.h"#include "vcf/FoundationKit/FoundationKitSelectLib.h"#include "vcf/FoundationKit/SmartPtr.h"#include "vcf/FoundationKit/VCFChar.h"#include "vcf/FoundationKit/VCFString.h"#include "vcf/FoundationKit/CommonDefines.h"#include "vcf/FoundationKit/VCFMath.h"#include "vcf/FoundationKit/VCFulong64.h"#include "vcf/FoundationKit/Enumerator.h"#include "vcf/FoundationKit/Interface.h"#include "vcf/FoundationKit/Object.h"#include "vcf/FoundationKit/CommandLine.h"namespace VCF{ /** \class FoundationKit FoundationKit.h "vcf/FoundationKit/FoundationKit.h" The FoundationKit class is used to initialize the Foundation Kit runtime. This includes registering the basic classes in the runtime system, such as the correct SystemToolkit implementation, and the ClassRegistry. FoundationKit::init() MUST be called at start up before anything else in the VCF is used. FoundationKit::terminate() MUST be called to free up any resources used by the FoundationKit. An example of proper usage looks like this: \code int main( int argc, char** argv ) { VCF::FoundationKit::init(argc, argv); //your code here VCF::FoundationKit::terminate(); return 0; } \endcode The FoundationKit is cannot be instantiated nor can it be derived from. @see SystemToolkit @see ClassRegistry */ class FOUNDATIONKIT_API FoundationKit { public: /** This is a special case exception used \em only for the triggering of an asertion, through the call to FoundationKit::assertCondition(). By having this as a special case and \em not deriving from BasicException, an assertion is prevented from being caught in a BasicException try/catch block. */ class Assertion : public std::exception { public: Assertion( const String& msg ) :msg_(msg){} virtual ~Assertion() throw() {} //make GCC happy :) virtual const char *what() const throw() { return msg_.ansi_c_str(); } private: String msg_; }; /** Initialization takes place here, plus creating the various system resources and peer instances. */ static void init( int argc, char** argv ); /** Frees up any resources allocated in the FoundationKit::init() function. */ static void terminate(); /** returns the CommandLine contents as passed into the FoundationKit::init() function. The CommandLine allows you easy access to any command like arguments passed into your application. See the CommandLine class for examples of how to use this class. @see CommandLine */ static const CommandLine& getCommandLine(); /** Use this to cause an assert to be fired. Currently an assert is implemented by throwing an exception. An assert is triggered if the condition is false. As a general rule you don't need to call this directly, instead use the VCF_ASSERT macro's because in addition to a message the macro will be able to also include the file and line number where the assertion was triggered, which is more useful. @param bool the condition - if this value is false, then an assert is triggered and an excpetion is thrown. @param failureMessage a string message indicating what failed. @see VCF_ASSERT */ static void assertCondition( bool condition, const String& failureMessage ); private : FoundationKit(); FoundationKit( const FoundationKit& ); ~FoundationKit(); };}; // end of namespace#include "vcf/FoundationKit/ErrorStrings.h"#include "vcf/FoundationKit/StringUtils.h"#include "vcf/FoundationKit/BasicException.h"#include "vcf/FoundationKit/BasicFileError.h"#include "vcf/FoundationKit/ClassNotFound.h"#include "vcf/FoundationKit/CantCreateObjectException.h"#include "vcf/FoundationKit/FileNotFound.h"#include "vcf/FoundationKit/InvalidPeer.h"#include "vcf/FoundationKit/InvalidPointerException.h"#include "vcf/FoundationKit/NoFreeMemException.h"#include "vcf/FoundationKit/NoPeerFoundException.h"#include "vcf/FoundationKit/NoSuchElementException.h"#include "vcf/FoundationKit/NotImplementedException.h"#include "vcf/FoundationKit/OutOfBoundsException.h"#include "vcf/FoundationKit/PropertyChangeException.h"#include "vcf/FoundationKit/RuntimeException.h"#include "vcf/FoundationKit/TypeCastException.h"#include "vcf/FoundationKit/ProcessException.h"#include "vcf/FoundationKit/Format.h"#include "vcf/FoundationKit/ProgramInfo.h"#include "vcf/FoundationKit/PackageInfo.h"#include "vcf/FoundationKit/Persistable.h"#include "vcf/FoundationKit/DateTime.h"#include "vcf/FoundationKit/FilePath.h"#include "vcf/FoundationKit/Event.h"#include "vcf/FoundationKit/EventHandler.h"#include "vcf/FoundationKit/Delegate.h"#include "vcf/FoundationKit/NotifyEvent.h"#include "vcf/FoundationKit/Class.h"#include "vcf/FoundationKit/InterfaceClass.h"#include "vcf/FoundationKit/Enum.h"#include "vcf/FoundationKit/PropertyChangeException.h"#include "vcf/FoundationKit/BasicFileError.h"#include "vcf/FoundationKit/FileIOError.h"#include "vcf/FoundationKit/MemStreamUtils.h"#include "vcf/FoundationKit/Stream.h"#include "vcf/FoundationKit/TextInputStream.h"#include "vcf/FoundationKit/TextOutputStream.h"#include "vcf/FoundationKit/BasicInputStream.h"#include "vcf/FoundationKit/BasicOutputStream.h"#include "vcf/FoundationKit/PropertyChangeEvent.h"#include "vcf/FoundationKit/VariantData.h"#include "vcf/FoundationKit/Property.h"#include "vcf/FoundationKit/Method.h"#include "vcf/FoundationKit/Field.h"#include "vcf/FoundationKit/ClassRegistry.h"#include "vcf/FoundationKit/ObjectWithEvents.h"//#include "vcf/FoundationKit/VCFRTTIImpl.h"//#include "vcf/FoundationKit/ClassInfo.h"#include "vcf/FoundationKit/Runnable.h"#include "vcf/FoundationKit/Waitable.h"#include "vcf/FoundationKit/File.h"#include "vcf/FoundationKit/Directory.h"#include "vcf/FoundationKit/Library.h"#include "vcf/FoundationKit/Locales.h"#include "vcf/FoundationKit/FileStream.h"#include "vcf/FoundationKit/Registry.h"#include "vcf/FoundationKit/System.h"#include "vcf/FoundationKit/SynchObject.h"#include "vcf/FoundationKit/Mutex.h"#include "vcf/FoundationKit/Condition.h"#include "vcf/FoundationKit/SemaphorePeer.h"#include "vcf/FoundationKit/Semaphore.h"#include "vcf/FoundationKit/Lock.h"#include "vcf/FoundationKit/Parser.h"#include "vcf/FoundationKit/SystemToolkit.h"#include "vcf/FoundationKit/FilePeer.h"#include "vcf/FoundationKit/ErrorLog.h"#include "vcf/FoundationKit/FileStreamPeer.h"#include "vcf/FoundationKit/LibraryPeer.h"#include "vcf/FoundationKit/MemoryStream.h"#include "vcf/FoundationKit/MutexPeer.h"#include "vcf/FoundationKit/RegistryPeer.h"#include "vcf/FoundationKit/ConditionPeer.h"#include "vcf/FoundationKit/SystemPeer.h"#include "vcf/FoundationKit/StringUtils.h"#include "vcf/FoundationKit/Thread.h"#include "vcf/FoundationKit/ThreadPeer.h"#include "vcf/FoundationKit/ThreadEvent.h"#include "vcf/FoundationKit/VCFProcess.h"#include "vcf/FoundationKit/ProcessPeer.h"#include "vcf/FoundationKit/XMLParser.h"#include "vcf/FoundationKit/VariantDataStream.h"/***resources handling/management*/#include "vcf/FoundationKit/Resource.h"#include "vcf/FoundationKit/ResourceBundle.h"#include "vcf/FoundationKit/ResourceException.h"/**What follows is documentation for the main VCF source documentaion page.\mainpageThis document is meant, first of all, as a general introduction to the VCF. It intends to orient you to the basic concepts of how the VCF is designed and how to begin using the features. Here抯 what it won抰 do: It won抰 teach you how to program; nor will it show you details about features of the framework (see the Reference Manual for this information); nor will it present you with step-by-step information about how to build a program. No, this document will paint a 揵ig picture
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?