diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-11-05 22:41:51 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-05 22:41:51 +0000 |
commit | ec05778d5718a7912e506764d443a78d6a6179e3 (patch) | |
tree | 78a9a01532180030c095acefc45763f07c14edb8 /src/stable/hex.h | |
parent | b20414ac1fe80a71a90601f4cd1767fa7014a9ba (diff) | |
download | libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.gz libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.bz2 libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.xz libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.zip |
Converted tabs to spaces with tabconv.
Diffstat (limited to '')
-rw-r--r-- | src/stable/hex.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/stable/hex.h b/src/stable/hex.h index a89e93d..c010173 100644 --- a/src/stable/hex.h +++ b/src/stable/hex.h | |||
@@ -12,46 +12,46 @@ | |||
12 | 12 | ||
13 | namespace Bu | 13 | namespace Bu |
14 | { | 14 | { |
15 | /** | 15 | /** |
16 | * This very simple filter encodes to/decodes from hex encoded string data. | 16 | * This very simple filter encodes to/decodes from hex encoded string data. |
17 | * The primary use of this filter is in debugging, use it with | 17 | * The primary use of this filter is in debugging, use it with |
18 | * Bu::encodeStr to easily create hex dumps of string data, even other raw | 18 | * Bu::encodeStr to easily create hex dumps of string data, even other raw |
19 | * structures. | 19 | * structures. |
20 | * | 20 | * |
21 | *@code | 21 | *@code |
22 | Bu::println("Hexdump: " + Bu::encodeStr<Bu::Hex>("Test data ;)") ); | 22 | Bu::println("Hexdump: " + Bu::encodeStr<Bu::Hex>("Test data ;)") ); |
23 | @endcode | 23 | @endcode |
24 | * Or... | 24 | * Or... |
25 | *@code | 25 | *@code |
26 | complex_struct data; | 26 | complex_struct data; |
27 | ... | 27 | ... |
28 | Bu::println("Hexdump: " + | 28 | Bu::println("Hexdump: " + |
29 | Bu::encodeStr<Bu::Hex>( | 29 | Bu::encodeStr<Bu::Hex>( |
30 | Bu::String( &data, sizeof(data) ) | 30 | Bu::String( &data, sizeof(data) ) |
31 | ) | 31 | ) |
32 | ); | 32 | ); |
33 | @endcode | 33 | @endcode |
34 | **/ | 34 | **/ |
35 | class Hex : public Bu::Filter | 35 | class Hex : public Bu::Filter |
36 | { | 36 | { |
37 | public: | 37 | public: |
38 | Hex( Bu::Stream &rNext, bool bUpperCase=false, int iChunk=-1 ); | 38 | Hex( Bu::Stream &rNext, bool bUpperCase=false, int iChunk=-1 ); |
39 | virtual ~Hex(); | 39 | virtual ~Hex(); |
40 | 40 | ||
41 | virtual void start(); | 41 | virtual void start(); |
42 | virtual Bu::size stop(); | 42 | virtual Bu::size stop(); |
43 | 43 | ||
44 | virtual Bu::size read( void *pBuf, Bu::size iBytes ); | 44 | virtual Bu::size read( void *pBuf, Bu::size iBytes ); |
45 | virtual Bu::size write( const void *pBuf, Bu::size iBytes ); | 45 | virtual Bu::size write( const void *pBuf, Bu::size iBytes ); |
46 | using Bu::Stream::write; | 46 | using Bu::Stream::write; |
47 | 47 | ||
48 | private: | 48 | private: |
49 | int iChunk; | 49 | int iChunk; |
50 | Bu::size iPos; | 50 | Bu::size iPos; |
51 | char cIn[2]; | 51 | char cIn[2]; |
52 | int iIn; | 52 | int iIn; |
53 | const char *sChrs; | 53 | const char *sChrs; |
54 | }; | 54 | }; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #endif | 57 | #endif |