add a .clang-format file (#9154)

This commit is contained in:
Jorropo
2026-01-03 14:19:24 -06:00
committed by GitHub
parent abab6ce815
commit 0d11331d18
771 changed files with 77733 additions and 83165 deletions
+21 -23
View File
@@ -31,18 +31,17 @@
#include <vector>
// Simple function to check a string 's' has at least 'n' characters
static inline bool simplejson_csnlen(const char *s, size_t n)
{
if (s == 0)
return false;
static inline bool simplejson_csnlen(const char *s, size_t n) {
if (s == 0)
return false;
const char *save = s;
while (n-- > 0) {
if (*(save++) == 0)
return false;
}
const char *save = s;
while (n-- > 0) {
if (*(save++) == 0)
return false;
}
return true;
return true;
}
// Custom types
@@ -52,22 +51,21 @@ typedef std::map<std::string, JSONValue *> JSONObject;
#include "JSONValue.h"
class JSON
{
friend class JSONValue;
class JSON {
friend class JSONValue;
public:
static JSONValue *Parse(const char *data);
static std::string Stringify(const JSONValue *value);
public:
static JSONValue *Parse(const char *data);
static std::string Stringify(const JSONValue *value);
protected:
static bool SkipWhitespace(const char **data);
static bool ExtractString(const char **data, std::string &str);
static double ParseInt(const char **data);
static double ParseDecimal(const char **data);
protected:
static bool SkipWhitespace(const char **data);
static bool ExtractString(const char **data, std::string &str);
static double ParseInt(const char **data);
static double ParseDecimal(const char **data);
private:
JSON();
private:
JSON();
};
#endif