CmdLineOutput.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. class CmdLineInterface;
  32. class ArgException;
  33. /**
  34. * The interface that any output object must implement.
  35. */
  36. class CmdLineOutput
  37. {
  38. public:
  39. /**
  40. * Virtual destructor.
  41. */
  42. virtual ~CmdLineOutput() {}
  43. /**
  44. * Generates some sort of output for the USAGE.
  45. * \param c - The CmdLine object the output is generated for.
  46. */
  47. virtual void usage(CmdLineInterface& c)=0;
  48. /**
  49. * Generates some sort of output for the version.
  50. * \param c - The CmdLine object the output is generated for.
  51. */
  52. virtual void version(CmdLineInterface& c)=0;
  53. /**
  54. * Generates some sort of output for a failure.
  55. * \param c - The CmdLine object the output is generated for.
  56. * \param e - The ArgException that caused the failure.
  57. */
  58. virtual void failure( CmdLineInterface& c,
  59. ArgException& e )=0;
  60. };
  61. } //namespace TCLAP
  62. #endif