Commit c4e0c324 authored by Alexander A. Maly's avatar Alexander A. Maly

Cleared away friends from kumirstdlib.hpp

Now everybody can unset Kumir error state, not only VM::Variable.
Also added non-inline non-virtual protected destructors to AbstractInputBuffer and AbstractOutputBuffer.
parent 975acccb
Pipeline #2322 passed with stages
in 4 minutes and 7 seconds
......@@ -33,6 +33,15 @@ static Encoding LOCALE_ENCODING = UTF8;
#endif
AbstractInputBuffer::~AbstractInputBuffer()
{
}
AbstractOutputBuffer::~AbstractOutputBuffer()
{
}
AbstractInputBuffer *Files::getConsoleInputBuffer()
{
return consoleInputBuffer;
......
......@@ -8,11 +8,6 @@
#include <deque>
namespace VM
{
class Variable;
}
namespace Kumir
{
......@@ -100,35 +95,13 @@ struct FileType {
FILE *handle;
};
class AbstractInputBuffer
{
public:
virtual bool readRawChar(Char &ch) = 0;
virtual void pushLastCharBack() = 0;
virtual void clear() = 0;
};
class AbstractOutputBuffer
{
public:
virtual void writeRawString(const String &) = 0;
};
class KS_DLL Core
{
friend class Math;
friend class Random;
friend class Files;
friend class StringUtils;
friend class System;
friend class IO;
friend class VM::Variable;
static String &takeError();
static void unsetError() { takeError().clear(); }
public:
static const String &getError();
static void unsetError() { takeError().clear(); }
static void init()
{
......@@ -417,9 +390,28 @@ public:
};
class KS_DLL AbstractInputBuffer
{
protected:
~AbstractInputBuffer();
public:
virtual bool readRawChar(Char &ch) = 0;
virtual void pushLastCharBack() = 0;
virtual void clear() = 0;
};
class KS_DLL AbstractOutputBuffer
{
protected:
~AbstractOutputBuffer();
public:
virtual void writeRawString(const String &) = 0;
};
class KS_DLL Files
{
friend class IO;
static bool isOpenedFiles();
public:
......@@ -442,7 +434,6 @@ public:
static bool canOpenForRead(const String &path);
static bool canOpenForWrite(const String &path);
static bool exist(const String &fileName);
static bool isDirectory(const String &fileName);
static bool unlink(const String &fileName);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment