Utilities (from namespace Scobey) Package Documentation
Version 2008.0
Modified during and after April, 2008
This is the Fall, 2008 version of the documentation for the instructor-supplied C++ utilities package to be used in CSCI 2341 and CSCI 2342. You will find here descriptions of some very useful (time-saving) constant definitions, free functions, and classes. It will take some time to become thoroughly familiar with all that is available, but you need to start using the package immediately and learn some new facilities each week as the term progresses.
Those who are familiar with this utilities package from last year should note the changes and additions listed below. Those who may have used it previous to that will find more significant changes and they should review the documentation in its entirety, as should those who are encountering the package for the first time.
- The DisplayIDInfo() free function has been renamed DisplayOpeningScreen(), but retains essentially the same functionality. This function is also now an inline function, which helps to avoid multiply-defined function name compile-time errors when utilities.h is included in several different source files of the same program. The two named constants which provide values for the default parameters of the DisplayOpeningScreen() function have also been renamed: DEFAULT_DESCRIPTION is now called DEFAULT_PROGRAM_INFO, and DEFAULT_ID_INFO is now called DEFAULT_PROGRAMMER_INFO.
- There is a new ClearScreen() function that clears the screen and positions the cursor to write at the bottom left corner of the screen. This a portable function that works simply by writing blank lines to the screen.
- The ReadLine() free function has been replaced by two very similar free functions, the ReadNextLine() function and the ReadThisLine() function. The ReadNextLine() function displays a prompt and moves the cursor to the next line for the user to enter as much as a full line of text, while the ReadThisLine() function displays a prompt and keeps the cursor on the same line as that prompt so that the user can enter (a presumably shorter piece of) text on the same line as the prompt. Note that the ReadNextLine() function has exactly the same functionality as the previous ReadLine() function. In both cases all text entered, except the terminating newline character, is read into the string variable receiving the input.
- There are three new constant arrays containing names: one containing 300 first names for females, one containing 300 first names for males, and one containing 100 family names, all ranked in the order of name frequency as observed in the United States and reported on the Internet at these sites:
www.census.gov/genealogy/names/dist.female.first
names.mongabay.com/male_names_alpha.htm
en.wikipedia.org/wiki/List_of_most_common_surnamesUnited_States