sharray.h

来自「Shorthand是一个强大的脚本语言」· C头文件 代码 · 共 39 行

H
39
字号
#ifndef __sharray_h
#define __sharray_h
///////////////////////////////////////////////////////////////////////////////
// $Header: /shorthand/src/sharray.h 1     1/09/03 7:14p Arm $
//-----------------------------------------------------------------------------
// Project: ShortHand interpreter
// Author: Andrei Remenchuk <andrei@remenchuk.com>
//-----------------------------------------------------------------------------
// sharray.cpp: ShortHand array class - declarations
///////////////////////////////////////////////////////////////////////////////
#include "value.h"
#include "object.h"

class ShhArray : public ShhObject
{
protected:
    ShhValue* m_items;
    ShhValue m_null;
    ShhValue m_count_property;
    int m_count;
    int m_capacity;


public:
    ShhArray(ShhModule& module, const YYLTYPE& location);
    void constructor(ShhValueList* args);
    bool hasMethod(const char* name);
    ShhValue executeMethod(const char* name, ShhValueList* args);
    ShhValue& getProperty(const char* name);
    ~ShhArray();

    void growTo(int n);
    ShhValue& get(int index);
    void set(int index, ShhValue value);
    int size() const;
    int setCount(int n);
};

#endif // __sharray_h

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?