string-dump.h 725 B

1234567891011121314151617181920212223242526
  1. // string-dump.h -- Abstract base class for dumping strings. -*- C++ -*-
  2. // Copyright 2011 The Go Authors. All rights reserved.
  3. // Use of this source code is governed by a BSD-style
  4. // license that can be found in the LICENSE file.
  5. #ifndef GO_STRING_DUMP_H
  6. #define GO_STRING_DUMP_H
  7. // This abstract class provides an interface strings for whatever purpose.
  8. // Used for example for exporting and dumping objects.
  9. class String_dump
  10. {
  11. public:
  12. // Write a string. Implements the String_dump interface.
  13. virtual void
  14. write_string(const std::string& s) = 0;
  15. // Implementors should override this member, to dump a formatted c string.
  16. virtual void
  17. write_c_string(const char*) = 0;
  18. };
  19. #endif // GO_STRING_DUMP_H