Files
Pyarmor-Static-Unpack-1shot/pyc_string.h
Michael Hansen bf3599c87a Move some output stream parameters forward.
This allows us to avoid removing parameter defaults for these functions.
2023-06-05 13:56:25 -07:00

38 lines
1002 B
C++

#ifndef _PYC_STRING_H
#define _PYC_STRING_H
#include "pyc_object.h"
#include "data.h"
#include <cstdio>
#include <string>
class PycString : public PycObject {
public:
PycString(int type = TYPE_STRING)
: PycObject(type) { }
bool isEqual(PycRef<PycObject> obj) const override;
bool isEqual(const std::string& str) const { return m_value == str; }
bool startsWith(const std::string& str) const
{
return m_value.substr(0, str.size()) == str;
}
void load(class PycData* stream, class PycModule* mod) override;
int length() const { return (int)m_value.size(); }
const char* value() const { return m_value.c_str(); }
const std::string &strValue() const { return m_value; }
void setValue(std::string str) { m_value = std::move(str); }
private:
std::string m_value;
};
void OutputString(std::ostream& stream, PycRef<PycString> str, char prefix,
bool triple = false, const char* parent_f_string_quote = nullptr);
#endif