2009-07-24 08:35:21 +00:00
|
|
|
#ifndef _PYC_STRING_H
|
|
|
|
#define _PYC_STRING_H
|
|
|
|
|
2011-10-23 17:48:10 -07:00
|
|
|
#include "pyc_object.h"
|
2011-10-23 19:33:24 -07:00
|
|
|
#include "data.h"
|
2009-07-24 19:52:47 +00:00
|
|
|
#include <cstdio>
|
|
|
|
|
2009-07-24 08:35:21 +00:00
|
|
|
class PycString : public PycObject {
|
|
|
|
public:
|
|
|
|
PycString(int type = TYPE_STRING)
|
|
|
|
: PycObject(type), m_value(0), m_length(0) { }
|
|
|
|
|
2014-01-20 22:21:56 -08:00
|
|
|
~PycString() { delete[] m_value; }
|
2009-07-24 08:35:21 +00:00
|
|
|
|
2019-10-02 14:40:25 -07:00
|
|
|
bool isEqual(PycRef<PycObject> obj) const override;
|
2009-07-27 00:23:49 +00:00
|
|
|
bool isEqual(const char* str) const;
|
2009-07-24 21:15:51 +00:00
|
|
|
|
2019-10-02 14:40:25 -07:00
|
|
|
void load(class PycData* stream, class PycModule* mod) override;
|
2009-07-24 08:35:21 +00:00
|
|
|
|
|
|
|
int length() const { return m_length; }
|
|
|
|
const char* value() const { return m_value; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
char* m_value;
|
|
|
|
int m_length;
|
|
|
|
};
|
|
|
|
|
2009-08-03 23:13:50 +00:00
|
|
|
void OutputString(PycRef<PycString> str, char prefix = 0,
|
2011-10-23 19:33:24 -07:00
|
|
|
bool triple = false, FILE* F = pyc_output);
|
2009-07-24 19:52:47 +00:00
|
|
|
|
2009-07-24 08:35:21 +00:00
|
|
|
#endif
|