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

Implementation of the size validator. More...

#include "advgetopt/validator_size.h"
#include "advgetopt/validator_double.h"
#include <cppthread/log.h>
#include <snapdev/int128_literal.h>
#include <snapdev/math.h>
#include <snapdev/poison.h>
Include dependency graph for validator_size.cpp:

Go to the source code of this file.

Classes

class  advgetopt::anonymous_namespace{validator_size.cpp}::validator_size_factory
 

Namespaces

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

Variables

validator_size_factory advgetopt::anonymous_namespace{validator_size.cpp}::g_validator_size_factory
 

Detailed Description

The advgetopt allows for validating the input parameters automatically. This one validator checks whether the input represents what is considered a valid size of bits or bytes.

This includes a floating point number followed by a suffix such as "kB" or "Gb" or "TiB".

Note
The size can also represents bits, even though it was written to read bytes. If your command line option is expecting a size in bits, this works just as expected.

The size conversions are based on the International System of Units (SI).

See: https://en.wikipedia.org/wiki/Kilobyte

Definition in file validator_size.cpp.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.