mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:47:43 +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
|
@ -29,10 +29,12 @@
|
|||
#include <AK/Function.h>
|
||||
#include <LibCore/CObject.h>
|
||||
|
||||
class CNetworkResponse;
|
||||
namespace Core {
|
||||
|
||||
class CNetworkJob : public CObject {
|
||||
C_OBJECT(CNetworkJob)
|
||||
class NetworkResponse;
|
||||
|
||||
class NetworkJob : public Object {
|
||||
C_OBJECT_ABSTRACT(NetworkJob)
|
||||
public:
|
||||
enum class Error {
|
||||
None,
|
||||
|
@ -41,15 +43,15 @@ public:
|
|||
ProtocolFailed,
|
||||
Cancelled,
|
||||
};
|
||||
virtual ~CNetworkJob() override;
|
||||
virtual ~NetworkJob() override;
|
||||
|
||||
Function<void(bool success)> on_finish;
|
||||
|
||||
bool is_cancelled() const { return m_error == Error::Cancelled; }
|
||||
bool has_error() const { return m_error != Error::None; }
|
||||
Error error() const { return m_error; }
|
||||
CNetworkResponse* response() { return m_response.ptr(); }
|
||||
const CNetworkResponse* response() const { return m_response.ptr(); }
|
||||
NetworkResponse* response() { return m_response.ptr(); }
|
||||
const NetworkResponse* response() const { return m_response.ptr(); }
|
||||
|
||||
virtual void start() = 0;
|
||||
virtual void shutdown() = 0;
|
||||
|
@ -61,13 +63,15 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
CNetworkJob();
|
||||
void did_finish(NonnullRefPtr<CNetworkResponse>&&);
|
||||
NetworkJob();
|
||||
void did_finish(NonnullRefPtr<NetworkResponse>&&);
|
||||
void did_fail(Error);
|
||||
|
||||
private:
|
||||
RefPtr<CNetworkResponse> m_response;
|
||||
RefPtr<NetworkResponse> m_response;
|
||||
Error m_error { Error::None };
|
||||
};
|
||||
|
||||
const char* to_string(CNetworkJob::Error);
|
||||
const char* to_string(NetworkJob::Error);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue