about
11/30/2022
CppUtilities Repo
CppUtilities Repository
Small helper utility classes - Command line, strings, time-dates, testing
Quick Status
1.0 Concept
1.1 Usage
1.2 Requirements
Each utility should:- Have no, or very few small and simple, packages on which it depends.
- Provide its functionality through inline definitions in its header file. There may be occasional utilities for which that isn't the preferred structure, usually because the utility already existed with implementation in its cpp file.
- Provide a simple interface that doesn't require knowledge of the utility's design.
- Have broad applicability.
2.0 Design
-
CodeUtilities provides ProcessCmdLine and Converter classes with all definitions inline
in its header file.
ProcessCmdLine provides facilities for parsing command line arguments, returning path, file patterns, and options, via methods of the class. The intent is that a using program create an instance of ProcessCmdLine, invoke its processing, and use that instance to access information about the command line rather than provide its own storage and accessors. Converter supports converting instances between string representations and their values. - StringUtilities defines functions that write console titles, trim strings, and provide string splits. All definitions are inline in its header file.
-
TestUtilities provides a simple single-user test harness for building regression tests.
Runs sequences of tests, defined as functors or lambdas, using a single try-catch block and pass fail enunciation. - UtilitiesEnvironment provides commonly used type aliases embedded in the Utilities namespace.
- DateTime provides a DateTime class that uses code defined in std::chrono.
-
DirExplorer-Events definds structs IDirEvent and IFileEvent and class DirExploreE.
Will be moved to another repository -
DirExplorer-Template defines class DirExplorerT<App> App is an application specific
class that defines processing for file and directory discovery.
Will be moved to another repository - Properties defines a class Property<T>
- SingletonLogger provides a struct ISingletonLogger<Category, Locker>, and classes SingletonLogger<T> and SingletonLoggerFactory<Category, Locker>. All of these are defined inline in the header files.
- WindowsHelpers provides string conversions and error message retrieval for the Windows API.
3.0 Status
- CodeUtilities contains a ProcessCmdLine class. I recently made changes to the interface it exposes in order to make it more flexible - driven by the creation of the tool FileFinder. ProcessCmdLine now expects paths as /P [somePath], provides default options for paths and patterns, e.g., "." and "*.*" respectively. It also parses /R regexp with default ".*", e.g., match anything.
- Code was built with Visual Studio Community Edition - 2019, and tested on Windows 10.