You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CmdLineOutput.h 2.2 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
  2. /******************************************************************************
  3. *
  4. * file: CmdLineOutput.h
  5. *
  6. * Copyright (c) 2004, Michael E. Smoot
  7. * Copyright (c) 2017, Google LLC
  8. * All rights reserved.
  9. *
  10. * See the file COPYING in the top directory of this distribution for
  11. * more information.
  12. *
  13. * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  16. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  19. * DEALINGS IN THE SOFTWARE.
  20. *
  21. *****************************************************************************/
  22. #ifndef TCLAP_CMDLINEOUTPUT_H
  23. #define TCLAP_CMDLINEOUTPUT_H
  24. #include <string>
  25. #include <vector>
  26. #include <list>
  27. #include <iostream>
  28. #include <iomanip>
  29. #include <algorithm>
  30. namespace TCLAP
  31. {
  32. class CmdLineInterface;
  33. class ArgException;
  34. /**
  35. * The interface that any output object must implement.
  36. */
  37. class CmdLineOutput
  38. {
  39. public:
  40. /**
  41. * Virtual destructor.
  42. */
  43. virtual ~CmdLineOutput()
  44. {
  45. }
  46. /**
  47. * Generates some sort of output for the USAGE.
  48. * \param c - The CmdLine object the output is generated for.
  49. */
  50. virtual void usage(CmdLineInterface& c) = 0;
  51. /**
  52. * Generates some sort of output for the version.
  53. * \param c - The CmdLine object the output is generated for.
  54. */
  55. virtual void version(CmdLineInterface& c) = 0;
  56. /**
  57. * Generates some sort of output for a failure.
  58. * \param c - The CmdLine object the output is generated for.
  59. * \param e - The ArgException that caused the failure.
  60. */
  61. virtual void failure(CmdLineInterface& c, ArgException& e) = 0;
  62. };
  63. } // namespace TCLAP
  64. #endif