Files
Pyarmor-Static-Unpack-1shot/pyc_string.h

30 lines
719 B
C
Raw Normal View History

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>
#include <string>
2009-07-24 19:52:47 +00:00
2009-07-24 08:35:21 +00:00
class PycString : public PycObject {
public:
PycString(int type = TYPE_STRING)
: PycObject(type) { }
2009-07-24 08:35:21 +00:00
bool isEqual(PycRef<PycObject> obj) const override;
bool isEqual(const std::string& str) const { return m_value == str; }
2009-07-24 21:15:51 +00:00
void load(class PycData* stream, class PycModule* mod) override;
2009-07-24 08:35:21 +00:00
int length() const { return (int)m_value.size(); }
const char* value() const { return m_value.c_str(); }
2009-07-24 08:35:21 +00:00
private:
std::string m_value;
2009-07-24 08:35:21 +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