XFoundation
alpha version, October 2000
The Epoc standard libraries offer moderate services, but the particular API is not quite programmer-friendly, and is not really object-oriented. Besides, there are many very basic services you just can't find there (like the hashed table or typeless containers). Thence, the XSdk offers a rich set of libraries, which try to be as much easy to use and as much object-clean as in the C++ possible. Naturally, as soon as the Objective C is available, the GNUStep luxury libraries will be used.
The XFoundation library offers a rich set of services for all the basic needs, and the other libraries and services are using it; thence "foundation". The current set of services will be considerably extended in future--remember that the current XSdk is in an extremely early state.
Note that all the XFoundation classes have a prefix "CX", the first "C" meaning they are a CBase-derived classes, and the rest standing for XFoundation. None of the methods return any exit code, for that is a nonsense when a proper exception support is available. So, any possible error is reported by an exception. That means in the Epoc-talk any methods can "leave"; thence the Epoc convention of the "L" suffix would be superfluous and is not used. All methods are virtual, as is normal in any sensible OO environment.
In a sense, these conventions are the reason why all the methods begin by a lowercase letter just like it is normally done in Java or ObjC: they follow rather these object-oriented conventions than the non-OO conventions of the C++ or Epoc SDK.
To be able to use any foundation class, you have to include just one header file: the "XFoundation.h". The appropriate library is linked in automatically, as soon as you add the XFoundation framework to the project (see the XSdk frameworks system). Have also look at the following documents:
- Types and constants: a few new types and constants, defined for the XFoundation needs;
- Object ownership and releasing: the full guide of object sharing (which was near to impossible in the plain Symbian SDK) and of the XSdk semi-automatic garbage collector;
- Language extensions: the XSdk extensions, which make the C++ language at least partially useable.
Currently, the XFoundation contains the following classes:
- CXObject: the primitive services, offered by any object in the XSdk. As a basic class for all other it is listed at the very beginning (have a look at the Types and constants as well), all the other classes are listed alphabetically;
- CXArray: a general and flexible typeless array object, able to contain just anything;
- CXAutoreleasePool: the particular implementation of the XSdk semi-automatic garbage collector;
- CXData: any byte-oriented data chunk. It is much more flexible than the Epoc descriptors--though currently unsupported, it is designed to eg. access memory-mapped files;
- CXDialog: the generic API defined on the Foundation level allows you to prepare and use dialogues regardless the particular GUI;
- CXDictionary: a hash-table based dictionary, allowing to store data with keys with more or less linear access time;
- CXEnumerator: a general class to access any sequential data;
- CXException: higher level API to replace the non-object-oriented Epoc Leave;
- CXObject was mentioned already, here we repeat it for cases someone searched for it in alphabetical order;
- CXSet: a hash-table based set, allowing to store unique instalnces of any data;
- CXString: a string class, due to reasonable design unlike the Epoc descriptors it can offer Unicode support with no future changes or extensions, partial Unicode support is offered already;
- CXStringEncoding: the class ensures an access to the loadable string encoding modules. This is the core of encoding translations, available thru the CXString class;
- CXUserDefaults: a luxury, dictionary- and object-based access to an INI file (in the Epoc-speak, a dictionary store).
Copyright © 1999-2000 X.soft, all rights reserved