Skip to content
Snippets Groups Projects

Remove more c_str with SetFileName string overload

Merged Victor Poughon requested to merge 513-SetFileName into develop

Summary

  • Make readers' and writers' SetFileName string overload the main one, and make const char* call it (instead of the over way around)
  • Remove 53 calls to c_str using:
find Modules/ Examples/ -type f -print0 | xargs -0 sed -i -E "s/SetFileName\((.*)\.c_str\(\)/SetFileName\(\1/"

Rationale

#513 (closed), the hunt for c_str

Implementation Details

Also replace some method type signatures with const string reference instead of string by value. Also adds the missing file otbWrapperOutputVectorDataParameter.cxx and move WrapperOutputVectorDataParameter code from the .h to the .cxx.

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 :thumbsup: votes from core developers, no :thumbsdown: vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
Edited by Victor Poughon

Merge request reports

Merged by Victor PoughonVictor Poughon 6 years ago (Aug 10, 2018 7:32am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Author Contributor

    @lnicola Maybe they could be remove at some point, yes. I haven't checked if they are used anywhere.

  • Victor Poughon added 2 commits

    added 2 commits

    • f862e904 - BUG: fix auto replace error on ImageSeriesFileReaderBase
    • aac3f2ce - BUG: fix auto replace & add missing cxx file

    Compare with previous version

  • Author Contributor

    I added two commits that:

    • Fix some auto replace errors
    • Adds the missing file otbWrapperOutputVectorDataParameter.cxx and move WrapperOutputVectorDataParameter code from the .h to the .cxx
  • Victor Poughon changed the description

    changed the description

  • Laurențiu Nicola resolved all discussions

    resolved all discussions

  • Antoine Regimbeau
  • Antoine Regimbeau
  • Victor Poughon added 1 commit

    added 1 commit

    • bb48391a - BUG: name parameters in method declaration

    Compare with previous version

  • Luc Hermitte
  • Luc Hermitte
  • Luc Hermitte
  • Victor Poughon added 2 commits

    added 2 commits

    • 84bae027 - BUG: keep same contract for SetFileName methods
    • b4baedbb - ENH: depreciate const char* overloads

    Compare with previous version

  • Author Contributor

    Regarding the contract of const char* overloads to avoid calling std:string(nullptr), I have made it so that they keep the same behavior when passed nullptr as they had before (which is inconsistent across classes) and deprecated them all.

  • There is no risk of improving the implicit contract to something explicit with an assertion. In all cases it will crash, the difference being that with an assertion, the crashes in debug mode will be more explicit.

  • Victor Poughon added 1 commit

    added 1 commit

    Compare with previous version

  • mentioned in issue #1682 (closed)

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading