ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
sample.hpp
Go to the documentation of this file.
1// #################################################################################################
2// ALib C++ Framework
3// App Sample
4//
5// Copyright 2025 A-Worx GmbH, Germany
6// Published under Boost Software License (a free software license, see LICENSE.txt)
7// #################################################################################################
8/// \file
9#ifndef HPP_ALIB_SAMPLES_APP
10#define HPP_ALIB_SAMPLES_APP
11#pragma once
12#include "ALib.Lang.H"
13#if !DOXYGEN // otherwise this sample would be seen in the ALib dox
14
15#include "ALib.App.H" // Module ALib App
16
17// Our custom app
18DOX_MARKER( [DOX_APP_SAMPLE_CLASS])
19class Sample : public alib::app::App {
20
21 enum class DateCommands {
22 Now = 1, ///< Returns the current date.
23 File = 2, ///< returns the modification date of a file or directory.
24 };
25
26 enum class DateOptions {
27 Format = 0, ///< Overwrite the default format string.
28 };
29
30 enum class DateParameters {
31 Filename = 0, ///< Used with command \e file to denote the file.
32 };
33
34 enum class DateExitCodes {
35 ErrMissingFilename = 101, ///< Command "file" given without a filename.
36 ErrFileNotFound = 102, ///< File given with command "file" not found.
37 ErrPermissionDenied = 103, ///< File given with command "file" not found.
38 };
39
40 alib::String64 format= "yyyy-MM-dd HH:mm:ss";
41
42 void onBsCLIDefine() override;
43 void onBsPrepareConfig() override;
44 bool processCLICmd(alib::app::Command* cmd ) override;
45
46 void bulkloadResources();
47};
48DOX_MARKER( [DOX_APP_SAMPLE_CLASS])
49
50// assigning ALib enum records
51ALIB_CAMP_ENUM( Sample::DateCommands , alib::app::ERCommandDecl , alib::APP, "DateC" )
52ALIB_CAMP_ENUM( Sample::DateOptions , alib::app::EROptionDecl , alib::APP, "DateO" )
53ALIB_CAMP_ENUM( Sample::DateParameters , alib::app::ERParameterDecl, alib::APP, "DateP" )
54ALIB_CAMP_ENUM( Sample::DateExitCodes , alib::app::ERExitCodeDecl , alib::APP, "DateE" )
55
56#endif // !DOXYGEN
57#endif // HPP_ALIB_SAMPLES_APP
#define ALIB_CAMP_ENUM(T, TRecord, Camp, ResName)
virtual void onBsPrepareConfig()
Definition app.cpp:351
virtual bool processCLICmd(Command *cmd)
Definition app.cpp:645
virtual void onBsCLIDefine()
Definition app.cpp:355
@ Filename
Denotes the actual source file as the scope.
Definition alox.cpp:14
LocalString< 64 > String64
Type alias name for #"TLocalString;TLocalString<character,64>".
app::AppCamp APP
The singleton instance of the camp class used by class #"App".
Definition appcamp.cpp:1
#"alib_enums_records;ALib Enum Record" type used by class #"CommandDecl".