Menu

#423 Add character functions

v1.1.x
closed
None
v1.1.2
New Functionality
2019-09-18
2018-12-17
Erik Hänel
No

Add character functions like is_alpha(), is_digit(), is_alnum(), etc. The full list is available at http://www.cplusplus.com/reference/cctype/ (tolower() and toupper() are already available).

The functions shall be able to return a set of logicals for the passed string, where each logical shall indicate, whether the corresponding character is of the checked type:

is_digit("4u93a")
ans = {1, 0, 1, 1, 0}

Analysis:

The implementation of most of these functions is quite straightforward. They'll have the standard signature VAL__STR or STR(like strfnc_ascii()). One can use the standard C library functions as indicated by the provided link. These functions have to be applied to each character of the passed string (the ascii() function is a quite good example).

Additionally, one has to keep in mind, that the german umlauts are probably not detected by the standard C library functions. If the test fails, then these have to be implemented manually (the functions to_uppercase() and to_lowercase() will provide the corresponding character codes).

Implementation:

  • Implementation: According to the analysis I have added the character functions
  • Revision: [r630]
  • Implementation test: I executed the character functions

Documentation:

  • ChangesLog: Updated
  • Comments: New functions commented
  • Documentation articles: Not needed
  • Language files: Updated

Tests:

Functionality was added to the automatic software tests. Remaining issues were fixed.

Related

Commit: [r630]

Discussion

  • Erik Hänel

    Erik Hänel - 2018-12-17
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2019-01-30
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,18 @@
     Add character functions like `is_alpha()`, `is_digit()`, `is_alnum()`, etc.
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###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 - 2019-02-02
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,14 @@
    -Add character functions like `is_alpha()`, `is_digit()`, `is_alnum()`, etc.
    +Add character functions like `is_alpha()`, `is_digit()`, `is_alnum()`, etc. The full list is available at http://www.cplusplus.com/reference/cctype/ (`tolower()` and `toupper()` are already available).
    +
    +The functions shall be able to return a set of logicals for the passed string, where each logical shall indicate, whether the corresponding character is of the checked type:
    +
    
    +    is_digit("4u93a")
    +    ans = {1, 0, 1, 1, 0}
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +The implementation of most of these functions is quite straightforward. They'll have the standard signature `VAL__STR` or `STR`(like `strfnc_ascii()`). One can use the standard C library functions as indicated by the provided link. These functions have to be applied to each character of the passed string (the `ascii()` function is a quite good example).
    +
    +Additionally, one has to keep in mind, that the german umlauts are probably not detected by the standard C library functions. If the test fails, then these have to be implemented manually (the functions `to_uppercase()` and `to_lowercase()` will provide the corresponding character codes). 
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
    • assigned_to: Erik Hänel --> Jonas Jansen
     
  • Jonas Jansen

    Jonas Jansen - 2019-09-16
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -11,15 +11,15 @@
     Additionally, one has to keep in mind, that the german umlauts are probably not detected by the standard C library functions. If the test fails, then these have to be implemented manually (the functions `to_uppercase()` and `to_lowercase()` will provide the corresponding character codes). 
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation: According to the analysis I have added the character functions
    +* Revision: [r630]
    +* Implementation test: I executed the character functions
    
     ###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: New functions commented
    +* Documentation articles: Not needed
    +* Language files: Updated
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
    • assigned_to: Jonas Jansen --> Erik Hänel
     

    Related

    Commit: [r630]

  • Erik Hänel

    Erik Hänel - 2019-09-18
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -22,4 +22,4 @@
    
     * Language files: Updated
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +Functionality was added to the automatic software tests. Remaining issues were fixed.
    
    • status: testing --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB