#ifndef GO_EXPORT_H
#define GO_EXPORT_H
+#include "string-dump.h"
+
struct sha1_ctx;
class Gogo;
class Import_init;
BUILTIN_INT = -11,
BUILTIN_UINT = -12,
BUILTIN_UINTPTR = -13,
- BUILTIN_FLOAT = -14,
BUILTIN_BOOL = -15,
BUILTIN_STRING = -16,
BUILTIN_COMPLEX64 = -17,
BUILTIN_COMPLEX128 = -18,
- BUILTIN_COMPLEX = -19,
+ BUILTIN_ERROR = -19,
SMALLEST_BUILTIN_CODE = -19
};
// loop of exporting. A pointer to this class is also passed to the
// various specific export implementations.
-class Export
+class Export : public String_dump
{
public:
// The Stream class is an interface used to output the exported
Stream();
virtual ~Stream();
- // Write a string.
+ // Write a string. Implements the String_dump interface.
void
write_string(const std::string& s)
{ this->write_and_sum_bytes(s.data(), s.length()); }
- // Write a nul terminated string.
+ // Write a nul terminated string. Implements the String_dump interface.
void
write_c_string(const char* s)
{ this->write_and_sum_bytes(s, strlen(s)); }
protected:
void
do_write(const char*, size_t);
-
- private:
- // The section we are writing to; this is really union section
- // defined in output.h.
- void* section_;
};
#endif // !defined(GO_EXPORT_H)