cpcc - Cross Platform C++ classes
cpcc library - cross platform C++ classes
cpcc is a minimal library of C++ classes.
Amongst others, it contains:
- a portable file system class a path helper class - allows manipulation of file paths
- a screensaver interface class
- a persistent settings class (similar to INI files)
- a portable color class
- a window class with simple drawing functions
- a time counter class a
- self-test class (allows you to run tests against your code, with minimal programming overhead). Every class can contain its self-test code, which is executed without extra tools of unit-testing libraries.
- (more to come)
- Small enough; can be easily included in your projects
- No need to precompile it. Compile it with your code while building your program
|cpcc_SelfTest||A MACRO that allows you to call selfTest() functions of your C++ classes.
Most C++ classes in the cpcc library contain a static selfTest() function, inside which self-test code is written that runs specific test scenarios and uses the ASSERT() function to flag errors.
There is a global switch to turn OFF all selftests. Otherwise, your code is always tests and changes that result to bugs are immediately spotted.
|cpccTypes||A C++ color class, containing also conversion from/to routines for other color types: COLORREF, NSColor, CGColor|
|Classes to create a cross platform screensaver for Windows and OSX. You will only need to subclass the cpccScreenSaverAbstract.|
|cpccInstanceCounterPattern||Abstract base class to perform instance counting.
Counts how many objects of a specific class were created.
Special functions onFirstCreate(), onLastDestroy can be overwritten to allow children classes perform initialization/finalisation.
|A class to store and manipulate number that have a range, like the float color components that have a range of 0.0 to 1.0. The class guaranties that you will never get a number that is out of its limits.|
|A small and portable (cross platform) C++ class to save/load application settings from an INI-like file.|
|cpccStackWithDefault<T>||The usual stack but with a default value. You get the default value if you have not pushed other values in.
In cpcc this is used in the drawing tool styles, where there is a default color, fontname, fontsize, etc, but you can also push/pop your specific styles when drawing specific areas.
|cpccTimeCounter||Cross platform C++ time interval counter|
|A CSS like class to hold some drawing styles and parameters.|
|cpccDrawingToolsAbstract<TdrawContext, TRect>||Abstract C++ class for gathering the various native drawing functions under one roof.|
|Drawing tools for CGContext, NSBitmapImageRep
|Image loading and drawing classes for windows and MAC|
|Window drawing classes for windows and MAC|
|A small and portable (cross platform) C++ class with basic file system functions.
Simply add the .h and the .cpp files in your application.
|A file logging class for log events of Info, Warning, Error.
Automatically finds the proper filename and folder to store the log file.
|cpccRandom||Class to generate random numbers.
Automatically initializes itself.
|A vector class with all the convenience functions (add, multiply, randomise, length, etc)|
|cpccRect<T>||cpccVectorTypes||Rectangle class with conversions to native gui rectangles like RECT and NSRect|
Class diagram of the cross platform screensaver classes. They take the window handler supplied by the operating system and pass it to an abstract screensaver class from which your own screensaver class must derive.