Consolix
Loading...
Searching...
No Matches
Consolix Framework Documentation
█████████ ████ ███
███░░░░░███ ░░███ ░░░
███ ░░░ ██████ ████████ █████ ██████ ░███ ████ █████ █████
░███ ███░░███░░███░░███ ███░░ ███░░███ ░███ ░░███ ░░███ ░░███
░███ ░███ ░███ ░███ ░███ ░░█████ ░███ ░███ ░███ ░███ ░░░█████░
░░███ ███░███ ░███ ░███ ░███ ░░░░███░███ ░███ ░███ ░███ ███░░░███
░░█████████ ░░██████ ████ █████ ██████ ░░██████ █████ █████ █████ █████
░░░░░░░░░ ░░░░░░ ░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░

Welcome to the Consolix Framework, a versatile library designed to streamline the development of console-based applications. Consolix provides core utilities, components, and abstractions that make building robust, maintainable applications faster and easier.

Features

  • Component-Based Architecture: Modular design with reusable components like logging, configuration management, and CLI parsing.
  • Service Locator: A flexible mechanism for global service registration and retrieval.
  • Customizable Execution Loops: Support for structured loops to suit a wide variety of application needs.
  • Enhanced Logging: Powered by LogIt, including console and file-based loggers.
  • JSON Support with Comments: Easily load and manage JSON configurations with comment support.
  • Cross-Platform: Seamlessly runs on Windows and POSIX-compatible systems. (For POSIX not fully tested)

Key Modules

  • Core:
    • ServiceLocator for global resource management.
    • Utilities for path handling, JSON processing, and more.
    • Application lifecycle management via AppComponentManager and ConsoleApplication.
  • Components:
    • TitleComponent: Manages the console window title.
    • LoggerComponent: Centralized logging for console and file output.
    • CliComponent: Simplifies command-line argument handling.
    • ConfigComponent: Loads configuration from JSON files with support for comments.
    • LogoComponent: Displays a custom ASCII logo in the console.
    • LoopComponent: Implements customizable application loops.
  • Utilities:

Example Usage

int main(int argc, char* argv[]) {
// Add logging functionality
// Display the application logo
// Handle command-line arguments
consolix::add<consolix::CliComponent>("MyApp", "Program description", [](auto& options) {
options.add_options()("debug", "Enable debug mode");
}, argc, argv);
// Load configuration from a JSON file
// Execute the main loop
CONSOLIX_STREAM() << "Executing main loop...";
});
}
#define CONSOLIX_STREAM()
Fallback for general logging.
Entry point for including all Consolix components.
std::shared_ptr< Component > add(Args &&... args)
Adds a new component to the application. Creates a new instance of the specified component type and a...
void run()
Runs the application. Processes all components in the application's main loop.

Documentation Structure

Main Sections:

  1. General Guidance
  2. Modules and Components
  3. Utilities
  4. Project Overview

Structure:

  • Core — foundational classes and utilities.
  • Components — modules implementing key application features.
  • Utilities — helper functions and modules.
  • Interfaces — interface classes defining the architecture of components.

License

Consolix is distributed under the MIT License. For details, see the LICENSE file.