-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fac6192
commit d4b6c30
Showing
34 changed files
with
782 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "common/ser_deser.h" | ||
|
||
namespace kuzu { | ||
namespace common { | ||
|
||
template<> | ||
void SerDeser::serializeValue<std::string>( | ||
const std::string& value, FileInfo* fileInfo, uint64_t& offset) { | ||
uint64_t valueLength = value.length(); | ||
FileUtils::writeToFile(fileInfo, (uint8_t*)&valueLength, sizeof(uint64_t), offset); | ||
FileUtils::writeToFile( | ||
fileInfo, (uint8_t*)value.data(), valueLength, offset + sizeof(uint64_t)); | ||
offset = offset + sizeof(uint64_t) + valueLength; | ||
} | ||
|
||
template<> | ||
void SerDeser::deserializeValue<std::string>( | ||
std::string& value, FileInfo* fileInfo, uint64_t& offset) { | ||
uint64_t valueLength = 0; | ||
deserializeValue<uint64_t>(valueLength, fileInfo, offset); | ||
value.resize(valueLength); | ||
FileUtils::readFromFile(fileInfo, (uint8_t*)value.data(), valueLength, offset); | ||
offset += valueLength; | ||
} | ||
|
||
} // namespace common | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.