8000 Add wrapper for binary stamps. But this wrapper will needs exeptions · postgrespro/libblobstamper@b2a0ae4 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2a0ae4

Browse files
Add wrapper for binary stamps. But this wrapper will needs exeptions
1 parent 39aed0f commit b2a0ae4

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

blobstamper/blob.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ class Blob
2929
std::string ShiftSingleStampStr(StampBase &stmp);
3030
};
3131

32-
3332
#endif /*BLOB_H*/

blobstamper/galley.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,21 @@ GalleyVector::ExtractStr(Blob &blob)
336336
return res;
337337
}
338338

339+
std::vector<std::vector<char>>
340+
GalleyVector::ExtractBin(Blob &blob)
341+
{
342+
std::vector<std::vector<char>> res;
343+
std::vector<Blob> blobs = extract_internal(blob);
344+
for(int i=0; i<blobs.size(); i++)
345+
{
346+
Blob blob = blobs[i];
347+
StampBase & stamp = stamps[i];
348+
std::vector<char> v = stamp.ExtractBin(blob);
349+
res.push_back(v);
350+
}
351+
return res;
352+
}
353+
339354
int
340355
GalleyVector::minSize()
341356
{

blobstamper/galley.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class GalleyVector : public GalleyBase
4444
GalleyVector(std::vector<std::reference_wrapper<StampBase>> arg) : stamps(arg) {};
4545
std::vector<Blob> extract_internal(Blob &blob);
4646
std::vector<std::string> ExtractStr(Blob &blob);
47+
std::vector<std::vector<char>> ExtractBin(Blob &blob);
4748

4849
int minSize() override;
4950
int maxSize() override;

0 commit comments

Comments
 (0)
0