Skip to content

Conversation

@SilPix
Copy link

@SilPix SilPix commented Jan 26, 2024

Asks for Filename!

When an instance of FileOperate is created, it asks the user for the directory and filename amongst other things.

Basically, the program flow now is:

  1. Ask the user the Directory(Base File-path) to limit the scope to.
  2. Ask the user if they want to create a file. If yes, create one and work on that file.
  3. If no, ask if the user wishes to edit a file in the Base Directory. If yes, ask how they wish to edit it.
  4. If the user says no, quit. There's nothing else to do here.

Minor Changes

  • The main.cpp file is used to demonstrate the header functions
  • Also, added some Private Functions
    • file_empty(): Checks if a file is empty. Not currently used.
    • filepath_empty(): Used to check if the file in a filepath is empty
    • convert_finalpath(): Used to concatenate the Base Filepath and the filename(created because I realized that I kept writing the same two lines over and over again.

The header now asks for the filename of the for creating a new one as well as for editing an existing file in the directory(basefilepath).

Also, added two new private variables. One for the 'filename', and one for 'finalpath': a concatenation of 'basefilepath' & 'filename'.

Finally, added 3 private functions: file_empty(), filepath_empty() and convert_finalpath().
Updated to work with the last change to the File-Operations header.
Better demonstrates the header files capabilities.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant