Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2d3bd10

Browse files
Change method names, so we can inherit Galleys from Stamp later
1 parent 407cd78 commit 2d3bd10

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

blobstamper/galley.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ GalleyVectorBase::minSize()
4949

5050

5151
std::vector<std::string>
52-
GalleyVectorStr::ExtractStr(Blob &blob)
52+
GalleyVectorStr::ExtractStrVector(Blob &blob)
5353
{
5454
std::vector<Blob> blobs = extract_internal(blob);
5555
std::vector<std::string> res(blobs.size());
@@ -62,7 +62,7 @@ GalleyVectorStr::ExtractStr(Blob &blob)
6262
}
6363

6464
std::vector<std::vector<char>>
65-
GalleyVectorBin::ExtractBin(Blob &blob)
65+
GalleyVectorBin::ExtractBinVector(Blob &blob)
6666
{
6767
std::vector<Blob> blobs = extract_internal(blob);
6868
std::vector<std::vector<char>> res(blobs.size());
@@ -348,7 +348,7 @@ GalleySetBase::extract_internal(Blob &blob)
348348
}
349349

350350
std::vector<std::string>
351-
GalleySetStr::ExtractStr(Blob &blob)
351+
GalleySetStr::ExtractStrSet(Blob &blob)
352352
{
353353
std::vector<std::string> res;
354354
std::vector<Blob> blobs = extract_internal(blob);
@@ -363,7 +363,7 @@ GalleySetStr::ExtractStr(Blob &blob)
363363
}
364364

365365
std::vector<std::vector<char>>
366-
GalleySetBin::ExtractBin(Blob &blob)
366+
GalleySetBin::ExtractBinSet(Blob &blob)
367367
{
368368
std::vector<std::vector<char>> res;
369369
std::vector<Blob> blobs = extract_internal(blob);

blobstamper/galley.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ class GalleyVectorStr: public GalleyVectorBase
5656
StampBaseStr & s_stamp;
5757
public:
5858
GalleyVectorStr(StampBaseStr & stamp_arg): GalleyVectorBase(stamp_arg), s_stamp(stamp_arg) {};
59-
std::vector<std::string> ExtractStr(Blob &blob);
59+
std::vector<std::string> ExtractStrVector(Blob &blob);
6060
};
6161

6262
class GalleyVectorBin: public GalleyVectorBase
6363
{
6464
StampBaseBin & b_stamp;
6565
public:
6666
GalleyVectorBin(StampBaseBin & stamp_arg): GalleyVectorBase(stamp_arg), b_stamp(stamp_arg) {};
67-
std::vector<std::vector<char>> ExtractBin(Blob &blob);
67+
std::vector<std::vector<char>> ExtractBinVector(Blob &blob);
6868
};
6969

7070

@@ -73,12 +73,12 @@ template<class T> class GalleyVectorV: public GalleyVectorBase
7373
StampBaseV<T>& v_stamp;
7474
public:
7575
GalleyVectorV(StampBaseV<T> & stamp_arg): GalleyVectorBase(stamp_arg), v_stamp(stamp_arg) {};
76-
std::vector<T> ExtractValues(Blob &blob);
76+
std::vector<T> ExtractValuesVector(Blob &blob);
7777
};
7878

7979

8080
template<class T> std::vector<T>
81-
GalleyVectorV<T>::ExtractValues(Blob &blob)
81+
GalleyVectorV<T>::ExtractValuesVector(Blob &blob)
8282
{
8383
std::vector<Blob> blobs = extract_internal(blob);
8484
std::vector<T> res(blobs.size());
@@ -108,7 +108,7 @@ class GalleySetBin : public GalleySetBase
108108
std::vector<std::reference_wrapper<StampBaseBin>> b_stamps;
109109
public:
110110
GalleySetBin(std::vector<std::reference_wrapper<StampBaseBin>> arg) : GalleySetBase(cast_arg(arg)), b_stamps(arg) {};
111-
std::vector<std::vector<char>> ExtractBin(Blob &blob);
111+
std::vector<std::vector<char>> ExtractBinSet(Blob &blob);
112112

113113
std::vector<std::reference_wrapper<StampBase>> cast_arg(std::vector<std::reference_wrapper<StampBaseBin>> in)
114114
{
@@ -127,7 +127,7 @@ class GalleySetStr : public GalleySetBase
127127
std::vector<std::reference_wrapper<StampBaseStr>> s_stamps;
128128
public:
129129
GalleySetStr(std::vector<std::reference_wrapper<StampBaseStr>> arg) : GalleySetBase(cast_arg(arg)), s_stamps(arg) {};
130-
std::vector<std::string> ExtractStr(Blob &blob);
130+
std::vector<std::string> ExtractStrSet(Blob &blob);
131131

132132
std::vector<std::reference_wrapper<StampBase>> cast_arg(std::vector<std::reference_wrapper<StampBaseStr>> in)
133133
{

t/300-galley.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ main()
4747
StampTwoChars stamp;
4848
GalleyVectorStr galley(stamp);
4949
Blob blob(short_sample, strlen(short_sample));
50-
std::vector<std::string> res = galley.ExtractStr(blob);
50+
std::vector<std::string> res = galley.ExtractStrVector(blob);
5151

5252
is(res[0], expected1, "GalleyVector, fixed size string stamp: First element of shifted list is ok");
5353
is(res[1], expected2, "GalleyVector, fixed size string stamp: Second element of shifted list is ok");
@@ -68,7 +68,7 @@ main()
6868
StampTwoCharsList stamp_charlist;
6969
GalleyVectorStr galley(stamp_charlist);
7070

71-
std::vector<std::string> res = galley.ExtractStr(blob);
71+
std::vector<std::string> res = galley.ExtractStrVector(blob);
7272
std::string str;
7373

7474
is(res[0], expected1, "GalleyVector, unlimited size string stamp: First element of shifted list is ok");
@@ -87,7 +87,7 @@ main()
8787
StampArithm<unsigned short int> stamp;
8888
GalleyVectorBin galley(stamp);
8989
Blob blob(short_sample, strlen(short_sample));
90-
std::vector<std::vector<char>> res = galley.ExtractBin(blob);
90+
std::vector<std::vector<char>> res = galley.ExtractBinVector(blob);
9191

9292
std::vector<char> v;
9393
unsigned short int * data;
@@ -113,7 +113,7 @@ main()
113113
StampArithm<signed int> stamp;
114114
GalleyVectorV<signed int> galley(stamp);
115115
Blob blob((char*)sample, sizeof(sample));
116-
std::vector<signed int> res = galley.ExtractValues(blob);
116+
std::vector<signed int> res = galley.ExtractValuesVector(blob);
117117
ok(!memcmp((void*) &sample, (void *) &res[0], sizeof(sample)), "GalleyVectorV returns ok");
118118
}
119119

@@ -133,7 +133,7 @@ main()
133133
StampSeveralChars stamp;
134134
GalleyVectorStr galley(stamp);
135135

136-
std::vector<std::string> res = galley.ExtractStr(blob);
136+
std::vector<std::string> res = galley.ExtractStrVector(blob);
137137
std::string str;
138138

139139
is(res[0], expected1, "GalleyVector, unlimited size string stamp: First element of shifted list is ok");
@@ -163,7 +163,7 @@ main()
163163

164164
GalleySetStr galley(stamps);
165165

166-
std::vector<std::string> res = galley.ExtractStr(blob);
166+
std::vector<std::string> res = galley.ExtractStrSet(blob);
167167
std::string str;
168168
str = res[0];
169169
is(str, expected1, "GalleySet, fixed size string stamps: First element of vector is ok");
@@ -196,7 +196,7 @@ main()
196196

197197
GalleySetStr galley(stamps);
198198

199-
std::vector<std::string> res = galley.ExtractStr(blob);
199+
std::vector<std::string> res = galley.ExtractStrSet(blob);
200200
std::string str;
201201

202202
str = res[0];
@@ -230,7 +230,7 @@ main()
230230

231231
GalleySetStr galley(stamps);
232232

233-
std::vector<std::string> res = galley.ExtractStr(blob);
233+
std::vector<std::string> res = galley.ExtractStrSet(blob);
234234
std::string str;
235235

236236
is(res[0], expected1, "GalleySet, unbounded size string stamp: First element of vector is ok");
@@ -275,7 +275,7 @@ main()
275275

276276
GalleySetStr galley(stamps);
277277

278-
std::vector<std::string> res = galley.ExtractStr(blob);
278+
std::vector<std::string> res = galley.ExtractStrSet(blob);
279279
std::string str;
280280

281281
str = res[0];
@@ -326,7 +326,7 @@ main()
326326

327327
GalleySetStr galley(stamps);
328328

329-
std::vector<std::string> res = galley.ExtractStr(blob);
329+
std::vector<std::string> res = galley.ExtractStrSet(blob);
330330
std::string str;
331331

332332
str = res[0];
@@ -374,7 +374,7 @@ main()
374374

375375
GalleySetStr galley(stamps);
376376

377-
std::vector<std::string> res = galley.ExtractStr(blob);
377+
std::vector<std::string> res = galley.ExtractStrSet(blob);
378378
std::string str;
379379

380380
str = res[0];
@@ -424,7 +424,7 @@ main()
424424

425425
GalleySetStr galley(stamps);
426426
try{
427-
std::vector<std::string> res = galley.ExtractStr(blob);
427+
std::vector<std::string> res = galley.ExtractStrSet(blob);
428428
ok(false, "GalleySet, not enough data");
429429
}
430430
catch (OutOfData)

t/test-chars-stamps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ std::string
9999
StampTwoCharsList::ExtractStr(Blob &blob)
100100
{
101101
std::string res = "";
102-
std::vector<std::string> list = galley.ExtractStr(blob);
102+
std::vector<std::string> list = galley.ExtractStrVector(blob);
103103

104104
for (std::string point : list)
105105
{

0 commit comments

Comments
 (0)