Stxxl  1.4.0
common/test_argument_helper.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002  *  common/test_argument_helper.cpp
00003  *
00004  *  Part of the STXXL. See http://stxxl.sourceforge.net
00005  *
00006  *  Copyright (C) 2010-2011 Raoul Steffen <R-Steffen@gmx.de>
00007  *
00008  *  Distributed under the Boost Software License, Version 1.0.
00009  *  (See accompanying file LICENSE_1_0.txt or copy at
00010  *  http://www.boost.org/LICENSE_1_0.txt)
00011  **************************************************************************/
00012 
00013 // Thanks Daniel Russel, Stanford University
00014 #include <Argument_helper.h>
00015 
00016 #include <iostream>
00017 #include <limits>
00018 
00019 int main(int argc, char **argv)
00020 {
00021     int int_v = 0;
00022     long long long_v = 0;
00023     unsigned int uint_v = 0;
00024     unsigned long long ulong_v = 0;
00025 
00026     dsr::Argument_helper ah;
00027     ah.new_named_int               ('i', "int", "INT                 ", "", int_v);
00028     ah.new_named_unsigned_int      ('u', "unsigned", "UNSIGNED INT   ", "", uint_v);
00029     ah.new_named_long_long         ('l', "long", "LONG LONG          ", "", long_v);
00030     ah.new_named_unsigned_long_long('c', "ulong", "UNSIGNED LONG LONG", "", ulong_v);
00031 
00032     ah.set_description("argument helper test");
00033     ah.set_author("Raoul Steffen, R-Steffen@gmx.de");
00034     ah.process(argc, argv);
00035 
00036     std::cout << "int is                " << int_v << std::endl;
00037     std::cout << "unsigned int is       " << uint_v << std::endl;
00038     std::cout << "long long is          " << long_v << std::endl;
00039     std::cout << "unsigned long long is " << ulong_v << std::endl;
00040 
00041     return 0;
00042 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines