Write a C++ program called uni.cc
that behaves as HW3, except
that it processes UTF-8 characters, as described in lecture.
                
The properties file can now be enormous. Here is an example:
~cs253/pub/UnicodeData.txt
.
Note that the properties file now has
a slightly different format than the previous, ASCII-only, file.
As before, the properties file need not be in any particular order, and “holes” may exist.                 
The -all
option is still valid, and refers to all the properties
found in the properties file.
                
Arguments are in this order:                 
-
(a dash, minus, or hyphen)
They’re the leading arguments that start with a dash.                 
When an argument is encountered without a dash, or you run out of arguments.                 
What if it does? It’s not an option. All the options are together, at the beginning. Anything after that is not an option.                 
Here are several sample runs. “%” is my prompt:                 
% echo -e 'a 5 \U3a9 \U4dca \U1f42e' >data % cat data a 5 Ω ䷊ 🐮 % ./a.out ~cs253/pub/UnicodeData.txt data % ./a.out -Lu -Ll ~cs253/pub/UnicodeData.txt data Ll: 1 Lu: 1 % ./a.out -all ~cs253/pub/UnicodeData.txt data Cc: 1 Cf: 0 Co: 0 Cs: 0 Ll: 1 Lm: 0 Lo: 0 Lt: 0 Lu: 1 Mc: 0 Me: 0 Mn: 0 Nd: 1 Nl: 0 No: 0 Pc: 0 Pd: 0 Pe: 0 Pf: 0 Pi: 0 Po: 0 Ps: 0 Sc: 0 Sk: 0 Sm: 0 So: 2 Zl: 0 Zp: 0 Zs: 4 % ./a.out -all ~cs253/pub/UnicodeData.txt ~cs253/pub/hamlet.txt Cc: 10412 Cf: 0 Co: 0 Cs: 0 Ll: 119683 Lm: 0 Lo: 0 Lt: 0 Lu: 16350 Mc: 0 Me: 0 Mn: 0 Nd: 0 Nl: 0 No: 0 Pc: 0 Pd: 422 Pe: 261 Pf: 0 Pi: 0 Po: 7418 Ps: 261 Sc: 0 Sk: 0 Sm: 48 So: 0 Zl: 0 Zp: 0 Zs: 27713
The requirements are the same as those for HW3, plus:                 
new
/delete
/new[]
/delete[]
, if you must do your
own memory allocation.
If you have any questions about the requirements, ask. In the real world, your programming tasks will almost always be vague and incompletely specified. Same here.                 
Use web checkin, or Linux checkin:                 
~cs253/bin/checkin HW4 uni.cc
Turn in someone else’s work.                 
Modified: 2017-02-28T13:42                  User: Guest                  Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |