Menu

#358 Create a fileparts function

v1.1.x
closed
None
v1.1.1
New Functionality
2018-11-16
2018-07-22
Erik Hänel
No

Create a fileparts function like the one in MATLAB:

{drive, path, filename, ext} = fileparts(filepath)

Analysis:

There are two things to do:

  • Create an internal representation for the fileparts() function, e.g. with the signature vector<string> getFileParts(const string&) either as part of the tools component or as member of the FileSystem class (latter one is preferred). The function should separate the passed file path into the drive letter, the path, the file name and the extension, e.g. "C:\Software\NumeRe\numere.exe" -> "C", "Software\NumeRe", "numere", "exe".
  • Create the corresponding string function for the string parser in stringparsing.cpp, e.g. as static string strfnc_fileparts(StringFuncArgs& funcArgs) with the signature STR. One can let inspire himself by getfilelist(). Additionally, the new function has to be registered in static map<string, StringFuncHandle> parser_getStringFuncHandles() and the corresponding language strings have to be created.

Implementation:

  • Implementation: The change in the FileSystem class was more than expected by the analysis. Multiple changes were carried out and the class is now able to distinguish between file and folder paths
  • Revision: [r417]
  • Implementation test: The function was applied to file and folder paths. All occured deviations were resolved

Documentation:

  • ChangesLog: updated
  • Comments: reworked sections of FileSystem were commented sufficiently.
  • Documentation articles: The search data bases were updated
  • Language files: The new function was added to the language strings

Tests:

This functionality was added to the automatic SW tests. No deviations detected.

Related

Commit: [r417]

Discussion

  • Erik Hänel

    Erik Hänel - 2018-07-22
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2018-07-25
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,19 @@
     Create a fileparts function like the one in MATLAB:
    
         {path, filename, ext} = fileparts(filepath)
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*)
    +* Implementation test: (*Describe the type of test, which you performed, and if it was succesful*)
    +
    +###Documentation:
    +* ChangesLog: (*Have you updated the changes log?*)
    +* Comments: (*Have you written comments in the code, which describe your change?*)
    +* Documentation articles: (*Have you updated the documentation articles?*)
    +* Language files: (*Have you updated the language files?*)
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2018-08-23
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -7,6 +7,7 @@
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*)
    +* Revision: [rXXX]
     * Implementation test: (*Describe the type of test, which you performed, and if it was succesful*)
    
     ###Documentation:
    
     
  • Erik Hänel

    Erik Hänel - 2018-08-26
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,9 +1,12 @@
     Create a fileparts function like the one in MATLAB:
    
    
    -    {path, filename, ext} = fileparts(filepath)
    +    {drive, path, filename, ext} = fileparts(filepath)
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +There are two things to do:
    +
    +* Create an internal representation for the `fileparts()` function, e.g. with the signature `vector<string> getFileParts(const string&)` either as part of the tools component or as member of the `FileSystem` class (latter one is preferred). The function should separate the passed file path into the drive letter, the path, the file name and the extension, e.g. `"C:\Software\NumeRe\numere.exe" -> "C", "Software\NumeRe", "numere", "exe"`.
    +* Create the corresponding string function for the string parser in `stringparsing.cpp`, e.g. as `static string strfnc_fileparts(StringFuncArgs& funcArgs)` with the signature `STR`. One can let inspire himself by `getfilelist()`. Additionally, the new function has to be registered in  `static map<string, StringFuncHandle> parser_getStringFuncHandles()` and the corresponding language strings have to be created.
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*)
    
    • status: analyzing --> implementing
    • assigned_to: Erik Hänel --> Jonas Jansen
     
  • Erik Hänel

    Erik Hänel - 2018-11-15
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -9,15 +9,15 @@
    
     * Create the corresponding string function for the string parser in `stringparsing.cpp`, e.g. as `static string strfnc_fileparts(StringFuncArgs& funcArgs)` with the signature `STR`. One can let inspire himself by `getfilelist()`. Additionally, the new function has to be registered in  `static map<string, StringFuncHandle> parser_getStringFuncHandles()` and the corresponding language strings have to be created.
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*)
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was succesful*)
    +* Implementation: The change in the `FileSystem` class was more than expected by the analysis. Multiple changes were carried out and the class is now able to distinguish between file and folder paths
    +* Revision: [r417]
    +* Implementation test: The function was applied to file and folder paths. All occured deviations were resolved
    
     ###Documentation:
    -* ChangesLog: (*Have you updated the changes log?*)
    -* Comments: (*Have you written comments in the code, which describe your change?*)
    -* Documentation articles: (*Have you updated the documentation articles?*)
    -* Language files: (*Have you updated the language files?*)
    +* ChangesLog: updated
    +* Comments: reworked sections of `FileSystem` were commented sufficiently.
    +* Documentation articles: The search data bases were updated
    +* Language files: The new function was added to the language strings
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
    • assigned_to: Jonas Jansen --> Erik Hänel
     

    Related

    Commit: [r417]

  • Erik Hänel

    Erik Hänel - 2018-11-16
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -20,4 +20,4 @@
    
     * Language files: The new function was added to the language strings
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +This functionality was added to the automatic SW tests. No deviations detected.
    
    • status: testing --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB