The Functions of the HomeUtility namespace
Now that we've covered that new construct, let's take a look at the functions declared in the HomeUtility namespace, starting with ReadDoubleFromLine, which is shown in Figure 13.10.
Figure 13.10. HomeUtility::ReadDoubleFromLine (from code\hmutil1.cpp)
bool HomeUtility::ReadDoubleFromLine(istream& is, double& Result) { double temp; xstring garbage; is >> Result; return CheckNumericInput(is); } |
This function isn't terribly complicated. It uses the standard library input operator >> to read the data from an input stream into a double called Result, calls a function named CheckNumericInput (shown in Figure 13.15 on page 931), and returns the result of that function to the user.
However, there is one ...
Get C++: A Dialog Programming with the C++ Standard Library now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.