Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7be5616

Browse files
Move most of the GalleySereies extract code to the separate function, so we can use it both for binary and string stamps
1 parent3171b32 commit7be5616

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

‎blobstamper/galley.cpp‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,28 @@ std::list<std::string>
1212
GalleySeries::Extract(Blob &blob)
1313
{
1414
std::list<std::string> res;
15+
std::list<Blob> blobs =extract_internal(blob);
16+
for(Blob blob : blobs)
17+
{
18+
std::string str= blob.ShiftSingleStampStr(stamp);
19+
res.push_back(str);
20+
}
21+
return res;
22+
}
23+
24+
25+
std::list<Blob>
26+
GalleySeries::extract_internal(Blob &blob)
27+
{
28+
std::list<Blob> res;
1529

1630
if (stamp.isFixedSize())
1731
{
32+
int size = stamp.minSize();
1833
while (1)
1934
{
20-
std::string el = blob.ShiftSingleStampStr(stamp);
21-
if (el.empty())
35+
Blob el = blob.ShiftBytes(size);
36+
if (el.isEmpty())
2237
break;
2338
res.push_back(el);
2439
}
@@ -77,8 +92,7 @@ GalleySeries::Extract(Blob &blob)
7792
remainder = el_size_f - el_size;
7893

7994
Blob blob2 = blob.ShiftBytes(el_size);
80-
std::string str = blob2.ShiftSingleStampStr(stamp);
81-
res.push_back(str);
95+
res.push_back(blob2);
8296
}
8397
free(count_oracle);
8498
}

‎blobstamper/galley.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class GalleySeries : public GalleyBase
2525
StampGeneric &stamp;
2626
public:
2727
GalleySeries(StampGeneric & stamp_arg) : stamp(stamp_arg) {};
28+
std::list<Blob>extract_internal(Blob &blob);
2829
std::list<std::string>Extract(Blob &blob);
2930
intminSize()override;
3031
intmaxSize()override {return -1;};/* Sereies always takes as much data as it can take*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp