IgnoreRestVisitor.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
  2. /******************************************************************************
  3. *
  4. * file: IgnoreRestVisitor.h
  5. *
  6. * Copyright (c) 2003, Michael E. Smoot .
  7. * All rights reserved.
  8. *
  9. * See the file COPYING in the top directory of this distribution for
  10. * more information.
  11. *
  12. * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  15. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  17. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  18. * DEALINGS IN THE SOFTWARE.
  19. *
  20. *****************************************************************************/
  21. #ifndef TCLAP_IGNORE_REST_VISITOR_H
  22. #define TCLAP_IGNORE_REST_VISITOR_H
  23. #include <tclap/Visitor.h>
  24. #include <tclap/Arg.h>
  25. namespace TCLAP {
  26. /**
  27. * A Visitor that tells the CmdLine to begin ignoring arguments after
  28. * this one is parsed.
  29. */
  30. class IgnoreRestVisitor: public Visitor
  31. {
  32. public:
  33. /**
  34. * Constructor.
  35. */
  36. IgnoreRestVisitor() : Visitor() {}
  37. /**
  38. * Sets Arg::_ignoreRest.
  39. */
  40. void visit() { Arg::beginIgnoring(); }
  41. };
  42. }
  43. #endif