GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wsjcpp/wsjcpp-arguments: Processors for application arguments

BranchesTags
Open more actions menu

Latest commit

 

History

35 Commits
35 Commits

Folders and files

NameName
Last commit message
Last commit date
scripts.wsjcpp
scripts.wsjcpp
 
 
src.wsjcpp
src.wsjcpp
 
 
src
src
 
 
unit-tests.wsjcpp
unit-tests.wsjcpp
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build_simple.sh
build_simple.sh
 
 
clean.sh
clean.sh
 
 
wsjcpp.yml
wsjcpp.yml
 
 

Repository files navigation

wsjcpp-arguments

Build Status Github Stars Github Stars Github Forks Total alerts Language grade: C/C++

Parsing and handling for application arguments

Intagrate to your project

wsjcpp install "https://github.com/wsjcpp/wsjcpp-arguments:master"

or include this files:

  • src.wsjcpp/wsjcpp_core/wsjcpp_core.h
  • src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp
  • src/wsjcpp_arguments.cpp
  • src/wsjcpp_arguments.h

Example usage

header argument_processor_test_program.h:

#ifndef ARGUMENT_PROCESSOR_MAIN_H
#define ARGUMENT_PROCESSOR_MAIN_H

#include <wsjcpp_arguments.h>

class ArgumentProcessorMain : public WsjcppArgumentProcessor {
    public:
        ArgumentProcessorMain();

        virtual bool applyParameterArgument(const std::string &sProgramName, const std::string &sArgumentName, const std::string &sValue);
        virtual bool applySingleArgument(const std::string &sProgramName, const std::string &sArgumentName);
        virtual int exec(const std::string &sProgramName, const std::vector<std::string> &vSubParams);
};

#endif // ARGUMENT_PROCESSOR_MAIN_H

source-code argument_processor_main.cpp:

#include "argument_processor_main.h"
#include <wsjcpp_core.h>

// ---------------------------------------------------------------------
// ArgumentProcessorMain

ArgumentProcessorMain::ArgumentProcessorMain() 
: WsjcppArgumentProcessor("test_program", "TODO description") {
    TAG = "ArgumentProcessorMain";
    // registrySingleArgument("--single", "What exactly do this single param?");
    // registryParameterArgument("-param", "N", "What need this param?");
    // registryExample("here example of command");
    // registryProcessor(new ArgumentProcessorOtherProcessor());
}

// ---------------------------------------------------------------------

bool ArgumentProcessorMain::applySingleArgument(const std::string &sProgramName, const std::string &sArgumentName) {
    WsjcppLog::err(TAG, "Not implemented");
    return false;
}

// ---------------------------------------------------------------------

bool ArgumentProcessorMain::applyParameterArgument(
    const std::string &sProgramName, 
    const std::string &sArgumentName, 
    const std::string &sValue
) {
    WsjcppLog::err(TAG, "Not implemented");
    return false;
}

// ---------------------------------------------------------------------

int ArgumentProcessorMain::exec(
    const std::vector<std::string> &vRoutes,
    const std::vector<std::string> &vSubParams
) {
    WsjcppLog::err(TAG, "Not implemented");
    return -1; 
}

usage:

#include <wsjcpp_arguments.h>
#include "argument_processor_main.h"


int main(int argc, const char* argv[]) {
    ArgumentProcessorMain *pMain = new ArgumentProcessorMain();
    WsjcppArguments prog(argc, argv, pMain);
    return prog.exec();
}

wsjcpp gen

wsjcpp gen WsjcppArgumentProcessor Main

After this will be created two files by template:

  • src/argument_processor_main.h
  • src/argument_processor_main.cpp

About

Processors for application arguments

Topics

argv-parsercppwsjcpp-package

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.