#include "tools/binary_size/libsupersize/viewer/caspian/file_format.h"
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <cstring>
#include <iostream>
#include <memory>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include "third_party/jsoncpp/source/include/json/json.h"
#include "third_party/zlib/google/compression_utils_portable.h"
#include "tools/binary_size/libsupersize/viewer/caspian/model.h"
namespace {
const char kDiffHeader[] = …;
const char kSerializationVersionSingleContainer[] = …;
const char kSerializationVersionMultiContainer[] = …;
int ReadLoneInt(char** rest) { … }
void Decompress(const char* gzipped,
unsigned long len,
std::vector<char>* uncompressed) { … }
std::vector<const char*> ReadValuesFromLine(char** rest,
const char* delimiter) { … }
template <typename T>
std::vector<T> ReadIntList(char** rest,
const char* delim,
int n,
bool stored_as_delta) { … }
template <typename T>
std::vector<std::vector<T>> ReadIntListForEachSection(
char** rest,
const std::vector<int>& symbol_counts,
bool stored_as_delta) { … }
void ReadJsonBlob(char** rest, Json::Value* fields) { … }
void CheckNoNonEmptyLinesRemain(char* rest) { … }
}
namespace caspian {
void CalculatePadding(std::vector<Symbol>* raw_symbols) { … }
void ParseSizeInfo(const char* gzipped, unsigned long len, SizeInfo* info) { … }
void ParseCompressedStringList(const char* gzipped,
unsigned long len,
std::vector<std::string>* string_list) { … }
bool IsDiffSizeInfo(const char* file, unsigned long len) { … }
void ParseDiffSizeInfo(char* file,
unsigned long len,
SizeInfo* before,
SizeInfo* after,
std::vector<std::string>* removed_sources,
std::vector<std::string>* added_sources) { … }
}