contrib/mul/mbl/mbl_read_int.h
Go to the documentation of this file.
00001 // This is mul/mbl/mbl_read_int.h
00002 #ifndef mbl_read_int_h_
00003 #define mbl_read_int_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Asks question and waits for an answer
00010 // \author tim, updated by me apparently!!!
00011 //  updated to vxl caringly in the way one can only do on a Friday afternoon by gvw
00012 //
00013 // - Function Name: mbl_read_int
00014 // - Synopsis:      int mbl_read_int(char* q_str, int default_int)
00015 // - Inputs:        q_str: A question 
00016 //                  default_int: Default answer
00017 //                  min_int: Min allowed value (optional)
00018 //                  max_int: Max allowed value (optional)
00019 // - Outputs:       -
00020 // - Returns:       The answer or a default
00021 // - Description:   Asks question and waits for an answer.
00022 //                  If the answer is an integer, returns it.
00023 //                  If the answer is an empty vcl_string (return)
00024 //                  then returns default.
00025 //                  Otherwise waits for another input.
00026 // - References:    -
00027 // - Example:
00028 // \code
00029 //    int new_scale = mbl_read_int("Scale?",5);
00030 //    int new_scale = mbl_read_int("Scale?",5,min_scale,max_scale);
00031 // \endcode
00032 
00033 int mbl_read_int(const char* q_str, int default_int);
00034 int mbl_read_int(const char* q_str, int default_int, int min_int, int max_int);
00035 
00036 #endif //mbl_read_int_h_