leveldb
Public Member Functions | Private Attributes | List of all members
leveldb::InternalKey Class Reference

#include <dbformat.h>

Public Member Functions

 InternalKey ()
 
 InternalKey (const Slice &user_key, SequenceNumber s, ValueType t)
 
void DecodeFrom (const Slice &s)
 
Slice Encode () const
 
Slice user_key () const
 
void SetFrom (const ParsedInternalKey &p)
 
void Clear ()
 
std::string DebugString () const
 

Private Attributes

std::string rep_
 

Detailed Description

Definition at line 144 of file dbformat.h.

Constructor & Destructor Documentation

§ InternalKey() [1/2]

leveldb::InternalKey::InternalKey ( )
inline

Definition at line 148 of file dbformat.h.

148 { } // Leave rep_ as empty to indicate it is invalid

§ InternalKey() [2/2]

leveldb::InternalKey::InternalKey ( const Slice user_key,
SequenceNumber  s,
ValueType  t 
)
inline

Definition at line 149 of file dbformat.h.

149  {
150  AppendInternalKey(&rep_, ParsedInternalKey(user_key, s, t));
151  }
std::string rep_
Definition: dbformat.h:146
Slice user_key() const
Definition: dbformat.h:159
void AppendInternalKey(std::string *result, const ParsedInternalKey &key)
Definition: dbformat.cc:18
Here is the call graph for this function:

Member Function Documentation

§ Clear()

void leveldb::InternalKey::Clear ( )
inline

Definition at line 166 of file dbformat.h.

166 { rep_.clear(); }
std::string rep_
Definition: dbformat.h:146
Here is the caller graph for this function:

§ DebugString()

std::string leveldb::InternalKey::DebugString ( ) const

Definition at line 34 of file dbformat.cc.

34  {
35  std::string result;
36  ParsedInternalKey parsed;
37  if (ParseInternalKey(rep_, &parsed)) {
38  result = parsed.DebugString();
39  } else {
40  result = "(bad)";
41  result.append(EscapeString(rep_));
42  }
43  return result;
44 }
std::string rep_
Definition: dbformat.h:146
bool ParseInternalKey(const Slice &internal_key, ParsedInternalKey *result)
Definition: dbformat.h:176
std::string EscapeString(const Slice &value)
Definition: logging.cc:42
Here is the call graph for this function:
Here is the caller graph for this function:

§ DecodeFrom()

void leveldb::InternalKey::DecodeFrom ( const Slice s)
inline

Definition at line 153 of file dbformat.h.

153 { rep_.assign(s.data(), s.size()); }
std::string rep_
Definition: dbformat.h:146
Here is the call graph for this function:
Here is the caller graph for this function:

§ Encode()

Slice leveldb::InternalKey::Encode ( ) const
inline

Definition at line 154 of file dbformat.h.

154  {
155  assert(!rep_.empty());
156  return rep_;
157  }
std::string rep_
Definition: dbformat.h:146
Here is the caller graph for this function:

§ SetFrom()

void leveldb::InternalKey::SetFrom ( const ParsedInternalKey p)
inline

Definition at line 161 of file dbformat.h.

161  {
162  rep_.clear();
163  AppendInternalKey(&rep_, p);
164  }
std::string rep_
Definition: dbformat.h:146
void AppendInternalKey(std::string *result, const ParsedInternalKey &key)
Definition: dbformat.cc:18
Here is the call graph for this function:

§ user_key()

Slice leveldb::InternalKey::user_key ( ) const
inline

Definition at line 159 of file dbformat.h.

159 { return ExtractUserKey(rep_); }
std::string rep_
Definition: dbformat.h:146
Slice ExtractUserKey(const Slice &internal_key)
Definition: dbformat.h:98
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

§ rep_

std::string leveldb::InternalKey::rep_
private

Definition at line 146 of file dbformat.h.


The documentation for this class was generated from the following files: