S R T B H P N

Chapter-3 Exercises


Programming Exercises: Class Relationships:
  1. Write all the code for a program that counts the number of directories rooted at some specified path. That will require you to use an executive package and packages DirExplorerN and FileSystem.
    DirExplorerN is one of the projects in the FileManager Repository, and FileSystem is in the FileSystem Repository.
  2. Repeat the first exercise, but now evaluate the size of the root path, e.g., the size of all files that belong to any of the directories on the specified path.
    Don't forget to include the sizes of all the files in the root directory.
  3. Using code from the FileDates repository, build a class that finds all the files within a specified range of dates.
    What you are asked to do is fairly easy to implement, so take the time to look carefully at the design of the FileDates compound object.
  4. Modify code in the TextFinder repository so you display N lines of code surrounding the matched text.
    This will require you to cache the last N/2 lines of code while searching, and look ahead N/2 lines when you find a match. A ciruclar buffer is one way to implement that caching. See Exercise 4:1 for an exercise to build a template circular buffer. You won't need templates for this buffer.
  5. Build an application, using the curl library and github API to list all the repositories provided by github.com/JimFawcett
    This exercise is significantly larger than most of the other exercises in this C++ story.