mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:17:35 +00:00
LibCore: Put all classes in the Core namespace and remove the leading C
I've been wanting to do this for a long time. It's time we start being consistent about how this stuff works. The new convention is: - "LibFoo" is a userspace library that provides the "Foo" namespace. That's it :^) This was pretty tedious to convert and I didn't even start on LibGUI yet. But it's coming up next.
This commit is contained in:
parent
b7e3810b5c
commit
2d39da5405
265 changed files with 1380 additions and 1167 deletions
|
@ -30,8 +30,10 @@
|
|||
#include <AK/StringView.h>
|
||||
#include <LibCore/CObject.h>
|
||||
|
||||
class CIODevice : public CObject {
|
||||
C_OBJECT_ABSTRACT(CIODevice)
|
||||
namespace Core {
|
||||
|
||||
class IODevice : public Object {
|
||||
C_OBJECT_ABSTRACT(IODevice)
|
||||
public:
|
||||
enum OpenMode {
|
||||
NotOpen = 0,
|
||||
|
@ -43,7 +45,7 @@ public:
|
|||
MustBeNew = 16,
|
||||
};
|
||||
|
||||
virtual ~CIODevice() override;
|
||||
virtual ~IODevice() override;
|
||||
|
||||
int fd() const { return m_fd; }
|
||||
unsigned mode() const { return m_mode; }
|
||||
|
@ -55,7 +57,6 @@ public:
|
|||
|
||||
bool has_error() const { return m_error != 0; }
|
||||
|
||||
|
||||
int read(u8* buffer, int length);
|
||||
|
||||
ByteBuffer read(int max_size);
|
||||
|
@ -78,13 +79,13 @@ public:
|
|||
|
||||
bool seek(i64, SeekMode = SeekMode::SetPosition, off_t* = nullptr);
|
||||
|
||||
virtual bool open(CIODevice::OpenMode) = 0;
|
||||
virtual bool open(IODevice::OpenMode) = 0;
|
||||
virtual bool close();
|
||||
|
||||
int printf(const char*, ...);
|
||||
|
||||
protected:
|
||||
explicit CIODevice(CObject* parent = nullptr);
|
||||
explicit IODevice(Object* parent = nullptr);
|
||||
|
||||
void set_fd(int);
|
||||
void set_mode(OpenMode mode) { m_mode = mode; }
|
||||
|
@ -103,3 +104,5 @@ private:
|
|||
OpenMode m_mode { NotOpen };
|
||||
Vector<u8> m_buffered_data;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue