advgetopt 2.0.49
Parse complex command line arguments and configuration files in C++.
Classes | Namespaces | Variables
validator_integer.cpp File Reference

Implementation of the integer validator. More...

#include "advgetopt/validator_integer.h"
#include <cppthread/log.h>
#include <snapdev/trim_string.h>
#include <snapdev/poison.h>
Include dependency graph for validator_integer.cpp:

Go to the source code of this file.

Classes

class  advgetopt::anonymous_namespace{validator_integer.cpp}::validator_integer_factory
 

Namespaces

namespace  advgetopt
 The advgetopt environment to parse command line options.
 
namespace  advgetopt::anonymous_namespace{validator_integer.cpp}
 

Variables

validator_integer_factory advgetopt::anonymous_namespace{validator_integer.cpp}::g_validator_integer_factory
 

Detailed Description

This validator is used to verify that a parameter represents a valid integer.

Note that the validator supports 64 bits integers by default. You can reduce the size by defining your parameter with a range as required by your application.

The value is checked for overflows on a signed 64 bits value.

The function supports decimal numbers by default (base 10). An introducer can be used to change the base as follow:

Note that a number that starts with 0 does not represent an octal number with the existing algorithm.

Definition in file validator_integer.cpp.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.