#ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_LEVELDB_CODING_H_
#define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_LEVELDB_CODING_H_
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "components/services/storage/indexed_db/locks/partitioned_lock_id.h"
#include "content/common/content_export.h"
#include "third_party/blink/public/common/indexeddb/indexeddb_key.h"
#include "third_party/blink/public/common/indexeddb/indexeddb_key_path.h"
namespace content {
namespace indexed_db {
const constexpr int64_t kLatestKnownSchemaVersion = …;
const constexpr int64_t kEarliestSupportedSchemaVersion = …;
}
CONTENT_EXPORT extern const unsigned char kMinimumIndexId;
CONTENT_EXPORT std::string MaxIDBKey();
CONTENT_EXPORT std::string MinIDBKey();
BlobJournalEntryType;
BlobJournalType;
CONTENT_EXPORT void EncodeByte(unsigned char value, std::string* into);
CONTENT_EXPORT void EncodeBool(bool value, std::string* into);
CONTENT_EXPORT void EncodeInt(int64_t value, std::string* into);
CONTENT_EXPORT void EncodeString(const std::u16string& value,
std::string* into);
CONTENT_EXPORT void EncodeStringWithLength(const std::u16string& value,
std::string* into);
CONTENT_EXPORT void EncodeBinary(const std::string& value, std::string* into);
CONTENT_EXPORT void EncodeBinary(base::span<const uint8_t> value,
std::string* into);
CONTENT_EXPORT void EncodeDouble(double value, std::string* into);
CONTENT_EXPORT void EncodeIDBKey(const blink::IndexedDBKey& value,
std::string* into);
[[nodiscard]] CONTENT_EXPORT bool MaybeEncodeIDBKey(
const blink::IndexedDBKey& value,
std::string* into);
CONTENT_EXPORT void EncodeSortableIDBKey(const blink::IndexedDBKey& value,
std::string* into);
CONTENT_EXPORT void EncodeIDBKeyPath(const blink::IndexedDBKeyPath& value,
std::string* into);
CONTENT_EXPORT void EncodeBlobJournal(const BlobJournalType& journal,
std::string* into);
[[nodiscard]] CONTENT_EXPORT bool DecodeByte(std::string_view* slice,
unsigned char* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeBool(std::string_view* slice,
bool* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeInt(std::string_view* slice,
int64_t* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeString(std::string_view* slice,
std::u16string* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeStringWithLength(
std::string_view* slice,
std::u16string* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeBinary(std::string_view* slice,
std::string* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeBinary(
std::string_view* slice,
base::span<const uint8_t>* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeDouble(std::string_view* slice,
double* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeIDBKey(
std::string_view* slice,
std::unique_ptr<blink::IndexedDBKey>* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeSortableIDBKey(
std::string_view serialized,
blink::IndexedDBKey* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeIDBKeyPath(
std::string_view* slice,
blink::IndexedDBKeyPath* value);
[[nodiscard]] CONTENT_EXPORT bool DecodeBlobJournal(std::string_view* slice,
BlobJournalType* journal);
CONTENT_EXPORT int CompareEncodedStringsWithLength(std::string_view* slice1,
std::string_view* slice2,
bool* ok);
[[nodiscard]] CONTENT_EXPORT bool ExtractEncodedIDBKey(std::string_view* slice,
std::string* result);
CONTENT_EXPORT int CompareEncodedIDBKeys(std::string_view* slice1,
std::string_view* slice2,
bool* ok);
CONTENT_EXPORT int Compare(std::string_view a,
std::string_view b,
bool index_keys);
CONTENT_EXPORT int CompareKeys(std::string_view a, std::string_view b);
CONTENT_EXPORT int CompareIndexKeys(std::string_view a, std::string_view b);
std::string IndexedDBKeyToDebugString(std::string_view key);
CONTENT_EXPORT PartitionedLockId
GetDatabaseLockId(std::u16string database_name);
CONTENT_EXPORT PartitionedLockId GetObjectStoreLockId(int64_t database_id,
int64_t object_store_id);
class KeyPrefix { … };
class SchemaVersionKey { … };
class MaxDatabaseIdKey { … };
class DataVersionKey { … };
class RecoveryBlobJournalKey { … };
class ActiveBlobJournalKey { … };
class EarliestSweepKey { … };
class EarliestCompactionKey { … };
class ScopesPrefix { … };
class DatabaseFreeListKey { … };
class DatabaseNameKey { … };
class DatabaseMetaDataKey { … };
class ObjectStoreMetaDataKey { … };
class IndexMetaDataKey { … };
class ObjectStoreFreeListKey { … };
class IndexFreeListKey { … };
class ObjectStoreNamesKey { … };
class IndexNamesKey { … };
class ObjectStoreDataKey { … };
class ExistsEntryKey { … };
class CONTENT_EXPORT BlobEntryKey { … };
class IndexDataKey { … };
}
#endif