1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

Add clang-format file

Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
This commit is contained in:
Robin Burchell 2019-05-28 11:53:16 +02:00 committed by Andreas Kling
parent c11351ac50
commit 0dc9af5f7e
286 changed files with 3244 additions and 2424 deletions

View file

@ -1,12 +1,15 @@
#pragma once
#include "Retainable.h"
#include "RetainPtr.h"
#include "Retainable.h"
#include "Types.h"
namespace AK {
enum ShouldChomp { NoChomp, Chomp };
enum ShouldChomp {
NoChomp,
Chomp
};
class StringImpl : public Retainable<StringImpl> {
public:
@ -22,7 +25,11 @@ public:
ssize_t length() const { return m_length; }
const char* characters() const { return m_characters; }
char operator[](ssize_t i) const { ASSERT(i >= 0 && i < m_length); return m_characters[i]; }
char operator[](ssize_t i) const
{
ASSERT(i >= 0 && i < m_length);
return m_characters[i];
}
unsigned hash() const
{
@ -32,10 +39,17 @@ public:
}
private:
enum ConstructTheEmptyStringImplTag { ConstructTheEmptyStringImpl };
explicit StringImpl(ConstructTheEmptyStringImplTag) : m_characters("") { }
enum ConstructTheEmptyStringImplTag {
ConstructTheEmptyStringImpl
};
explicit StringImpl(ConstructTheEmptyStringImplTag)
: m_characters("")
{
}
enum ConstructWithInlineBufferTag { ConstructWithInlineBuffer };
enum ConstructWithInlineBufferTag {
ConstructWithInlineBuffer
};
StringImpl(ConstructWithInlineBufferTag, ssize_t length);
void compute_hash() const;
@ -63,6 +77,6 @@ inline dword string_hash(const char* characters, int length)
}
using AK::StringImpl;
using AK::Chomp;
using AK::string_hash;
using AK::StringImpl;