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

Commit0e32185

Browse files
Move arithmetics types stamps to a single template. Will call this template StampArythm for now
1 parent6f12166 commit0e32185

File tree

15 files changed

+61
-263
lines changed

15 files changed

+61
-263
lines changed

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ endif
99
BLOB_STAMPER_OBJ = blobstamper/blob.o\
1010
blobstamper/helpers.o\
1111
blobstamper/stamp.o\
12-
blobstamper/stamp_atomic.o\
12+
blobstamper/stamp_arithm.o\
1313
blobstamper/stamp_dict.o\
1414
blobstamper/galley.o\
1515
blobstamper/dict.o\

‎blobstamper/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ALL_OBJS = blob.o\
33
helpers.o\
44
stamp.o\
5-
stamp_atomic.o\
5+
stamp_arithm.o\
66
stamp_dict.o\
77
galley.o\
88
dict.o\

‎blobstamper/blobstamper.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
#include"blob.h"
33
#include"stamp.h"
4-
#include"stamp_atomic.h"
4+
#include"stamp_arithm.h"
55
#include"stamp_dict.h"
66
#include"dict.h"
77
#include"galley.h"

‎blobstamper/galley.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include"blob.h"
77
#include"stamp.h"
8-
#include"stamp_atomic.h"
8+
#include"stamp_arithm.h"
99
#include"galley.h"
1010

1111

‎blobstamper/galley.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
#include<vector>
88
#include<functional>// for std::reference_wrapper
99

10-
11-
#defineORACLE_STAMP StampBinInt16
1210
#defineORACLE_TYPEunsignedshortint
11+
#defineORACLE_STAMP StampArithm<ORACLE_TYPE>
1312
#defineORACLE_SIZEsizeof(ORACLE_TYPE)
1413
#defineORACLE_MAX USHRT_MAX
1514

‎blobstamper/helpers.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifndef HELPERS_H
2+
#defineHELPERS_H
13

24
voidhexdump(void *pAddressIn,long lSize);
35

@@ -74,3 +76,4 @@ max precision
7476
"%.999g", __val);
7577
}
7678

79+
#endif/*HELPERS_H*/

‎blobstamper/stamp_arithm.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include"blob.h"
2+
#include"stamp.h"
3+
#include"stamp_arithm.h"
4+

‎blobstamper/stamp_arithm.h‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#ifndef STAMP_ATOMIC_H
2+
#defineSTAMP_ATOMIC_H
3+
4+
#include<string>
5+
#include"helpers.h"
6+
7+
template<classT>classStampArithm:publicStampFixed
8+
{
9+
public:
10+
StampArithm() { size =sizeof(T);};
11+
std::stringExtractStr(Blob &blob)override;
12+
};
13+
14+
template<classT> std::string
15+
StampArithm<T>::ExtractStr(Blob &blob)
16+
{
17+
std::string res;
18+
T *pT = (T *)this->ExtractBin(blob);
19+
if (! pT)
20+
return"";
21+
res =to_string_precise(*pT);
22+
free(pT);
23+
return res;
24+
}
25+
26+
#endif/* STAMP_ATOMIC_H*/

‎blobstamper/stamp_atomic.cpp‎

Lines changed: 0 additions & 137 deletions
This file was deleted.

‎blobstamper/stamp_atomic.h‎

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp