Skip to content

Commit

Permalink
clang-format: switch tabs to spaces
Browse files Browse the repository at this point in the history
I like tabs, but I have to admit that spaces make source code more
consistent, because every editor/viewer tends to render tabs differently :(
  • Loading branch information
DarthGandalf committed Dec 7, 2015
1 parent 3861b6a commit d185d6f
Show file tree
Hide file tree
Showing 131 changed files with 39,975 additions and 39,976 deletions.
1 change: 0 additions & 1 deletion .clang-format
Expand Up @@ -2,7 +2,6 @@
BasedOnStyle: Google
Standard: Cpp11

UseTab: ForIndentation
IndentWidth: 4
TabWidth: 4
AccessModifierOffset: -2
Expand Down
128 changes: 64 additions & 64 deletions include/znc/Buffer.h
Expand Up @@ -29,86 +29,86 @@ class CClient;

class CBufLine {
public:
CBufLine() : CBufLine("") {
throw 0;
} // shouldn't be called, but is needed for compilation
CBufLine(const CMessage& Format, const CString& sText = "");
/// @deprecated
CBufLine(const CString& sFormat, const CString& sText = "",
const timeval* ts = nullptr,
const MCString& mssTags = MCString::EmptyMap);
~CBufLine();
CMessage ToMessage(const CClient& Client, const MCString& mssParams) const;
/// @deprecated Use ToMessage() instead
CString GetLine(const CClient& Client, const MCString& mssParams) const;
/// @deprecated
void UpdateTime();
CBufLine() : CBufLine("") {
throw 0;
} // shouldn't be called, but is needed for compilation
CBufLine(const CMessage& Format, const CString& sText = "");
/// @deprecated
CBufLine(const CString& sFormat, const CString& sText = "",
const timeval* ts = nullptr,
const MCString& mssTags = MCString::EmptyMap);
~CBufLine();
CMessage ToMessage(const CClient& Client, const MCString& mssParams) const;
/// @deprecated Use ToMessage() instead
CString GetLine(const CClient& Client, const MCString& mssParams) const;
/// @deprecated
void UpdateTime();

bool Equals(const CMessage& Format) const {
return m_Message.Equals(Format);
}
bool Equals(const CMessage& Format) const {
return m_Message.Equals(Format);
}

// Setters
void SetFormat(const CString& sFormat) { m_Message.Parse(sFormat); }
void SetText(const CString& sText) { m_sText = sText; }
void SetTime(const timeval& ts) { m_Message.SetTime(ts); }
void SetTags(const MCString& mssTags) { m_Message.SetTags(mssTags); }
// !Setters
// Setters
void SetFormat(const CString& sFormat) { m_Message.Parse(sFormat); }
void SetText(const CString& sText) { m_sText = sText; }
void SetTime(const timeval& ts) { m_Message.SetTime(ts); }
void SetTags(const MCString& mssTags) { m_Message.SetTags(mssTags); }
// !Setters

// Getters
const CString& GetCommand() const { return m_Message.GetCommand(); }
CString GetFormat() const {
return m_Message.ToString(CMessage::ExcludeTags);
}
const CString& GetText() const { return m_sText; }
timeval GetTime() const { return m_Message.GetTime(); }
const MCString& GetTags() const { return m_Message.GetTags(); }
// !Getters
// Getters
const CString& GetCommand() const { return m_Message.GetCommand(); }
CString GetFormat() const {
return m_Message.ToString(CMessage::ExcludeTags);
}
const CString& GetText() const { return m_sText; }
timeval GetTime() const { return m_Message.GetTime(); }
const MCString& GetTags() const { return m_Message.GetTags(); }
// !Getters

private:
protected:
CMessage m_Message;
CString m_sText;
CMessage m_Message;
CString m_sText;
};

class CBuffer : private std::deque<CBufLine> {
public:
CBuffer(unsigned int uLineCount = 100);
~CBuffer();
CBuffer(unsigned int uLineCount = 100);
~CBuffer();

size_type AddLine(const CMessage& Format, const CString& sText = "");
size_type UpdateLine(const CString& sCommand, const CMessage& Format,
const CString& sText = "");
size_type UpdateExactLine(const CMessage& Format,
const CString& sText = "");
size_type AddLine(const CMessage& Format, const CString& sText = "");
size_type UpdateLine(const CString& sCommand, const CMessage& Format,
const CString& sText = "");
size_type UpdateExactLine(const CMessage& Format,
const CString& sText = "");

size_type AddLine(const CString& sFormat, const CString& sText = "",
const timeval* ts = nullptr,
const MCString& mssTags = MCString::EmptyMap);
/// Same as AddLine, but replaces a line whose format string starts with sMatch if there is one.
size_type UpdateLine(const CString& sMatch, const CString& sFormat,
const CString& sText = "");
/// Same as UpdateLine, but does nothing if this exact line already exists.
/// We need this because "/version" sends us the 005 raws again
size_type UpdateExactLine(const CString& sFormat,
const CString& sText = "");
const CBufLine& GetBufLine(unsigned int uIdx) const;
CString GetLine(size_type uIdx, const CClient& Client,
const MCString& msParams = MCString::EmptyMap) const;
size_type Size() const { return size(); }
bool IsEmpty() const { return empty(); }
void Clear() { clear(); }
size_type AddLine(const CString& sFormat, const CString& sText = "",
const timeval* ts = nullptr,
const MCString& mssTags = MCString::EmptyMap);
/// Same as AddLine, but replaces a line whose format string starts with sMatch if there is one.
size_type UpdateLine(const CString& sMatch, const CString& sFormat,
const CString& sText = "");
/// Same as UpdateLine, but does nothing if this exact line already exists.
/// We need this because "/version" sends us the 005 raws again
size_type UpdateExactLine(const CString& sFormat,
const CString& sText = "");
const CBufLine& GetBufLine(unsigned int uIdx) const;
CString GetLine(size_type uIdx, const CClient& Client,
const MCString& msParams = MCString::EmptyMap) const;
size_type Size() const { return size(); }
bool IsEmpty() const { return empty(); }
void Clear() { clear(); }

// Setters
bool SetLineCount(unsigned int u, bool bForce = false);
// !Setters
// Setters
bool SetLineCount(unsigned int u, bool bForce = false);
// !Setters

// Getters
unsigned int GetLineCount() const { return m_uLineCount; }
// !Getters
// Getters
unsigned int GetLineCount() const { return m_uLineCount; }
// !Getters
private:
protected:
unsigned int m_uLineCount;
unsigned int m_uLineCount;
};

#endif // !ZNC_BUFFER_H

0 comments on commit d185d6f

Please sign in to comment.