puntoexe / Imebra (http://imebra.com/)

Imebra is a multiplatform open source C++ Dicom library from Puntoexe.

Clone this repository (size: 1.0 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/puntoexe/imebra/
commit 123: b8926cb540ff
parent 122: 7c6584da7c4d
branch: default
- Fixes #55 for the dataHandlers and base objects
pa...@puntoexe.com
9 months ago

Changed (Δ6.2 KB):

raw changeset »

project_files/base/include/baseObject.h (1 lines added, 1 lines removed)

project_files/base/include/baseStream.h (6 lines added, 6 lines removed)

project_files/base/include/charsetConversion.h (19 lines added, 19 lines removed)

project_files/base/include/exception.h (1 lines added, 1 lines removed)

project_files/base/include/huffmanTable.h (4 lines added, 4 lines removed)

project_files/base/include/memory.h (3 lines added, 3 lines removed)

project_files/base/include/memoryStream.h (1 lines added, 1 lines removed)

project_files/base/include/nullStream.h (1 lines added, 1 lines removed)

project_files/base/include/stream.h (3 lines added, 3 lines removed)

project_files/base/include/streamWriter.h (2 lines added, 2 lines removed)

project_files/base/src/baseObject.cpp (1 lines added, 1 lines removed)

project_files/base/src/charsetConversion.cpp (5 lines added, 5 lines removed)

project_files/base/src/exception.cpp (1 lines added, 1 lines removed)

project_files/base/src/huffmanTable.cpp (52 lines added, 52 lines removed)

project_files/base/src/memory.cpp (4 lines added, 4 lines removed)

project_files/base/src/memoryStream.cpp (2 lines added, 2 lines removed)

project_files/base/src/stream.cpp (3 lines added, 3 lines removed)

project_files/base/src/streamWriter.cpp (3 lines added, 3 lines removed)

project_files/examples/dicom2jpeg/nbproject/project.xml (3 lines added, 0 lines removed)

project_files/imebra/include/LUT.h (1 lines added, 1 lines removed)

project_files/imebra/include/buffer.h (4 lines added, 4 lines removed)

project_files/imebra/include/charsetsList.h (2 lines added, 2 lines removed)

project_files/imebra/include/dataHandler.h (28 lines added, 28 lines removed)

project_files/imebra/include/dataHandlerDate.h (6 lines added, 6 lines removed)

project_files/imebra/include/dataHandlerDateTime.h (5 lines added, 5 lines removed)

project_files/imebra/include/dataHandlerDateTimeBase.h (15 lines added, 15 lines removed)

project_files/imebra/include/dataHandlerNumeric.h (53 lines added, 53 lines removed)

project_files/imebra/include/dataHandlerString.h (32 lines added, 20 lines removed)

project_files/imebra/include/dataHandlerStringAE.h (3 lines added, 3 lines removed)

project_files/imebra/include/dataHandlerStringAS.h (11 lines added, 11 lines removed)

project_files/imebra/include/dataHandlerStringCS.h (3 lines added, 3 lines removed)

project_files/imebra/include/dataHandlerStringDS.h (8 lines added, 8 lines removed)

project_files/imebra/include/dataHandlerStringIS.h (5 lines added, 5 lines removed)

project_files/imebra/include/dataHandlerStringLO.h (3 lines added, 3 lines removed)

project_files/imebra/include/dataHandlerStringLT.h (5 lines added, 5 lines removed)

project_files/imebra/include/dataHandlerStringPN.h (4 lines added, 4 lines removed)

project_files/imebra/include/dataHandlerStringSH.h (3 lines added, 3 lines removed)

project_files/imebra/include/dataHandlerStringST.h (4 lines added, 4 lines removed)

project_files/imebra/include/dataHandlerStringUI.h (4 lines added, 4 lines removed)

project_files/imebra/include/dataHandlerStringUT.h (4 lines added, 4 lines removed)

project_files/imebra/include/dataHandlerStringUnicode.h (6 lines added, 6 lines removed)

project_files/imebra/include/dataHandlerTime.h (6 lines added, 6 lines removed)

project_files/imebra/include/image.h (7 lines added, 7 lines removed)

project_files/imebra/src/buffer.cpp (4 lines added, 4 lines removed)

project_files/imebra/src/charsetsList.cpp (5 lines added, 5 lines removed)

project_files/imebra/src/dataHandler.cpp (12 lines added, 68 lines removed)

project_files/imebra/src/dataHandlerDate.cpp (9 lines added, 9 lines removed)

project_files/imebra/src/dataHandlerDateTime.cpp (5 lines added, 5 lines removed)

project_files/imebra/src/dataHandlerDateTimeBase.cpp (42 lines added, 27 lines removed)

project_files/imebra/src/dataHandlerString.cpp (96 lines added, 31 lines removed)

Up to file-list project_files/base/include/baseObject.h:

@@ -320,7 +320,7 @@ public:
320
320
	///                      to lock this one
321
321
	///
322
322
	///////////////////////////////////////////////////////////
323
	baseObject(ptr<baseObject> externalLock);
323
	baseObject(const ptr<baseObject>& externalLock);
324
324
325
325
	/// \brief Creates the baseObject object and set an
326
326
	///         external object to be used for the lock.

Up to file-list project_files/base/include/baseStream.h:

@@ -69,7 +69,7 @@ public:
69
69
	///                        buffer that has to be written
70
70
	///
71
71
	///////////////////////////////////////////////////////////
72
	virtual void write(imbxUint32 startPosition, imbxUint8* pBuffer, imbxUint32 bufferLength) = 0;
72
	virtual void write(imbxUint32 startPosition, const imbxUint8* pBuffer, imbxUint32 bufferLength) = 0;
73
73
	
74
74
	/// \brief Read raw data from the stream.
75
75
	///
@@ -102,7 +102,7 @@ public:
102
102
class streamException: public std::runtime_error
103
103
{
104
104
public:
105
	streamException(std::string message): std::runtime_error(message){}
105
	streamException(const std::string& message): std::runtime_error(message){}
106
106
};
107
107
108
108
@@ -115,7 +115,7 @@ public:
115
115
class streamExceptionOpen : public streamException
116
116
{
117
117
public:
118
	streamExceptionOpen(std::string message): streamException(message){}
118
	streamExceptionOpen(const std::string& message): streamException(message){}
119
119
};
120
120
121
121
@@ -129,7 +129,7 @@ public:
129
129
class streamExceptionRead : public streamException
130
130
{
131
131
public:
132
	streamExceptionRead(std::string message): streamException(message){}
132
	streamExceptionRead(const std::string& message): streamException(message){}
133
133
};
134
134
135
135
@@ -143,7 +143,7 @@ public:
143
143
class streamExceptionWrite : public streamException
144
144
{
145
145
public:
146
	streamExceptionWrite(std::string message): streamException(message){}
146
	streamExceptionWrite(const std::string& message): streamException(message){}
147
147
};
148
148
149
149
@@ -157,7 +157,7 @@ public:
157
157
class streamExceptionClose : public streamException
158
158
{
159
159
public:
160
	streamExceptionClose(std::string message): streamException(message){}
160
	streamExceptionClose(const std::string& message): streamException(message){}
161
161
};
162
162
163
163
} // namespace puntoexe

Up to file-list project_files/base/include/charsetConversion.h:

2
2
$fileHeader$
3
3
*/
4
4
5
/*! \file charsetConversion.h
6
    \brief Declaration of the class used to convert a string between different
7
	        charsets.
8
9
The class hides the platform specific implementations and supplies a common
10
 interface for the charsets translations.
11
12
*/
5
/*! \file charsetConversion.h
6
    \brief Declaration of the class used to convert a string between different
7
	        charsets.
8
9
The class hides the platform specific implementations and supplies a common
10
 interface for the charsets translations.
11
12
*/
13
13
14
14
#if !defined(imebraCharsetConversion_3146DA5A_5276_4804_B9AB_A3D54C6B123A__INCLUDED_)
15
15
#define imebraCharsetConversion_3146DA5A_5276_4804_B9AB_A3D54C6B123A__INCLUDED_
@@ -78,7 +78,7 @@ public:
78
78
	///                   be used for the conversion
79
79
	///
80
80
	///////////////////////////////////////////////////////////
81
	void initialize(std::string tableName);
81
	void initialize(const std::string& tableName);
82
82
83
83
	/// \brief Retrieve the ISO name of the charset currently
84
84
	///         used for the conversion.
@@ -86,7 +86,7 @@ public:
86
86
	/// @return the ISO name of the active charset
87
87
	///
88
88
	///////////////////////////////////////////////////////////
89
	std::string getIsoCharset();
89
	std::string getIsoCharset() const;
90
90
91
91
	/// \brief Transform a multibyte string into an unicode
92
92
	///         string using the charset declared with the
@@ -98,7 +98,7 @@ public:
98
98
	/// @param unicodeStr
99
99
	///
100
100
	///////////////////////////////////////////////////////////
101
	std::string fromUnicode(std::wstring unicodeString);
101
	std::string fromUnicode(const std::wstring& unicodeString) const;
102
102
103
103
	/// \brief Transform a multibyte string into an unicode
104
104
	///         string using the charset declared with the
@@ -112,21 +112,21 @@ public:
112
112
	/// @return            the converted unicode string
113
113
	///
114
114
	///////////////////////////////////////////////////////////
115
	std::wstring toUnicode(std::string asciiString);
115
	std::wstring toUnicode(const std::string& asciiString) const;
116
116
117
117
protected:
118
118
	void close();
119
119
120
	int findTable(std::string tableName);
120
	int findTable(const std::string& tableName) const;
121
121
122
122
	std::string m_isoCharset;
123
123
124
124
#if defined(PUNTOEXE_USEICONV)
125
125
126
126
#if defined(WIN32)
127
	std::string myIconv(iconv_t context, const char* inputString, size_t inputStringLengthBytes);
127
	static std::string myIconv(iconv_t context, const char* inputString, size_t inputStringLengthBytes);
128
128
#else
129
	std::string myIconv(iconv_t context, char* inputString, size_t inputStringLengthBytes);
129
	static std::string myIconv(iconv_t context, char* inputString, size_t inputStringLengthBytes);
130
130
#endif
131
131
	iconv_t m_iconvToUnicode;
132
132
	iconv_t m_iconvFromUnicode;
@@ -187,7 +187,7 @@ protected:
187
187
class charsetConversionException: public std::runtime_error
188
188
{
189
189
public:
190
	charsetConversionException(std::string message): std::runtime_error(message){}
190
	charsetConversionException(const std::string& message): std::runtime_error(message){}
191
191
};
192
192
193
193
@@ -199,7 +199,7 @@ public:
199
199
class charsetConversionExceptionNoTable: public charsetConversionException
200
200
{
201
201
public:
202
	charsetConversionExceptionNoTable(std::string message): charsetConversionException(message){}
202
	charsetConversionExceptionNoTable(const std::string& message): charsetConversionException(message){}
203
203
};
204
204
205
205
@@ -211,7 +211,7 @@ public:
211
211
class charsetConversionExceptionNoSupportedTable: public charsetConversionException
212
212
{
213
213
public:
214
	charsetConversionExceptionNoSupportedTable(std::string message): charsetConversionException(message){}
214
	charsetConversionExceptionNoSupportedTable(const std::string& message): charsetConversionException(message){}
215
215
};
216
216
217
217
@@ -223,7 +223,7 @@ public:
223
223
class charsetConversionExceptionUtfSizeNotSupported: public charsetConversionException
224
224
{
225
225
public:
226
	charsetConversionExceptionUtfSizeNotSupported(std::string message): charsetConversionException(message){}
226
	charsetConversionExceptionUtfSizeNotSupported(const std::string& message): charsetConversionException(message){}
227
227
};
228
228
229
229

Up to file-list project_files/base/include/exception.h:

@@ -61,7 +61,7 @@ public:
61
61
	///                       exception being rethrown
62
62
	///
63
63
	///////////////////////////////////////////////////////////
64
	exceptionInfo(std::wstring functionName, std::string fileName, long lineNumber, std::string exceptionType, std::string exceptionMessage);
64
	exceptionInfo(const std::wstring& functionName, const std::string& fileName, const long lineNumber, const std::string& exceptionType, const std::string& exceptionMessage);
65
65
66
66
	exceptionInfo();
67
67
	

Up to file-list project_files/base/include/huffmanTable.h:

@@ -175,7 +175,7 @@ public:
175
175
	///                  write the code
176
176
	///
177
177
	///////////////////////////////////////////////////////////
178
	void writeHuffmanCode(imbxUint32* pBuffer, streamWriter* pStream);
178
	void writeHuffmanCode(const imbxUint32* pBuffer, streamWriter* pStream);
179
179
180
180
	//@}
181
181
@@ -245,19 +245,19 @@ public:
245
245
class huffmanException: public std::runtime_error
246
246
{
247
247
public:
248
	huffmanException(std::string message): std::runtime_error(message){}
248
	huffmanException(const std::string& message): std::runtime_error(message){}
249
249
};
250
250
251
251
class huffmanExceptionRead : public huffmanException
252
252
{
253
253
public:
254
	huffmanExceptionRead(std::string message): huffmanException(message){}
254
	huffmanExceptionRead(const std::string& message): huffmanException(message){}
255
255
};
256
256
257
257
class huffmanExceptionWrite : public huffmanException
258
258
{
259
259
public:
260
	huffmanExceptionWrite(std::string message): huffmanException(message){}
260
	huffmanExceptionWrite(const std::string& message): huffmanException(message){}
261
261
};
262
262
263
263

Up to file-list project_files/base/include/memory.h:

@@ -57,7 +57,7 @@ public:
57
57
	///                      must be transferred
58
58
	///
59
59
	///////////////////////////////////////////////////////////
60
	void transfer(ptr<memory> transferFrom);
60
	void transfer(const ptr<memory>& transferFrom);
61
61
62
62
	/// \brief Copy the content of the memory managed
63
63
	///         by another memory object into the memory 
@@ -67,7 +67,7 @@ public:
67
67
	///                      which the data has to be copied
68
68
	///
69
69
	///////////////////////////////////////////////////////////
70
	void copyFrom(ptr<memory> sourceMemory);
70
	void copyFrom(const ptr<memory>& sourceMemory);
71
71
72
72
	/// \brief Clear the content of the managed string of 
73
73
	///         bytes.
@@ -127,7 +127,7 @@ public:
127
127
	///                      into the managed memory
128
128
	///
129
129
	///////////////////////////////////////////////////////////
130
	void assign(imbxUint8* pSource, imbxUint32 sourceLength);
130
	void assign(const imbxUint8* pSource, const imbxUint32 sourceLength);
131
131
132
132
	/// \internal
133
133
	/// \brief This function is called by 

Up to file-list project_files/base/include/memoryStream.h:

@@ -53,7 +53,7 @@ public:
53
53
	// Virtual stream's functions
54
54
	//
55
55
	///////////////////////////////////////////////////////////
56
	virtual void write(imbxUint32 startPosition, imbxUint8* pBuffer, imbxUint32 bufferLength);
56
	virtual void write(imbxUint32 startPosition, const imbxUint8* pBuffer, imbxUint32 bufferLength);
57
57
	virtual imbxUint32 read(imbxUint32 startPosition, imbxUint8* pBuffer, imbxUint32 bufferLength);
58
58
59
59
protected:

Up to file-list project_files/base/include/nullStream.h:

@@ -43,7 +43,7 @@ public:
43
43
	// Virtual stream's functions
44
44
	//
45
45
	///////////////////////////////////////////////////////////
46
	virtual void write(imbxUint32, imbxUint8*, imbxUint32){}
46
	virtual void write(imbxUint32, const imbxUint8*, imbxUint32){}
47
47
	virtual imbxUint32 read(imbxUint32 , imbxUint8* , imbxUint32 ){return 0;}
48
48
};
49
49

Up to file-list project_files/base/include/stream.h:

@@ -74,16 +74,16 @@ public:
74
74
	///                   the files ARE OPENED IN BINARY MODE.
75
75
	///
76
76
	///////////////////////////////////////////////////////////
77
	void openFile(std::string fileName, int mode);
77
	void openFile(const std::string& fileName, const int mode);
78
78
79
	void openFile(std::wstring fileName, int mode);
79
	void openFile(const std::wstring& fileName, const int mode);
80
80
81
81
	///////////////////////////////////////////////////////////
82
82
	//
83
83
	// Virtual stream's functions
84
84
	//
85
85
	///////////////////////////////////////////////////////////
86
	virtual void write(imbxUint32 startPosition, imbxUint8* pBuffer, imbxUint32 bufferLength);
86
	virtual void write(imbxUint32 startPosition, const imbxUint8* pBuffer, imbxUint32 bufferLength);
87
87
	virtual imbxUint32 read(imbxUint32 startPosition, imbxUint8* pBuffer, imbxUint32 bufferLength);
88
88
89
89
protected:

Up to file-list project_files/base/include/streamWriter.h:

@@ -84,7 +84,7 @@ public:
84
84
	///                   written to the stream
85
85
	///
86
86
	///////////////////////////////////////////////////////////
87
	void write(imbxUint8* pBuffer, imbxUint32 bufferLength);
87
	void write(const imbxUint8* pBuffer, imbxUint32 bufferLength);
88
88
89
89
	/// \brief Write the specified amount of bits to the
90
90
	///         stream.
@@ -102,7 +102,7 @@ public:
102
102
	///                  The function can write 32 bits maximum
103
103
	///                   
104
104
	///////////////////////////////////////////////////////////
105
	inline void writeBits(imbxUint32* const pBuffer, int bitsNum)
105
	inline void writeBits(const imbxUint32* pBuffer, int bitsNum)
106
106
	{
107
107
		PUNTOEXE_FUNCTION_START(L"streamWriter::writeBits");
108
108

Up to file-list project_files/base/src/baseObject.cpp:

@@ -146,7 +146,7 @@ baseObject::baseObject():m_lockCounter(0
146
146
//
147
147
///////////////////////////////////////////////////////////
148
148
///////////////////////////////////////////////////////////
149
baseObject::baseObject(ptr<baseObject> externalLock): m_externalLock(externalLock),
149
baseObject::baseObject(const ptr<baseObject>& externalLock): m_externalLock(externalLock),
150
150
	m_lockCounter(0), m_bValid(true), m_pExceptionsManager(exceptionsManager::getExceptionsManager())
151
151
{
152
152
}

Up to file-list project_files/base/src/charsetConversion.cpp:

@@ -77,7 +77,7 @@ charsetConversion::~charsetConversion()
77
77
// Find the ID of the charset with the specified name
78
78
//
79
79
///////////////////////////////////////////////////////////
80
int charsetConversion::findTable(std::string tableName)
80
int charsetConversion::findTable(const std::string& tableName) const
81
81
{
82
82
	PUNTOEXE_FUNCTION_START(L"charsetConversion::findTable");
83
83
@@ -100,7 +100,7 @@ int charsetConversion::findTable(std::st
100
100
// Initialize the charsetConversion object
101
101
//
102
102
///////////////////////////////////////////////////////////
103
void charsetConversion::initialize(std::string tableName)
103
void charsetConversion::initialize(const std::string& tableName)
104
104
{
105
105
	PUNTOEXE_FUNCTION_START(L"charsetConversion::initialize");
106
106
@@ -200,7 +200,7 @@ void charsetConversion::close()
200
200
// Return the ISO name of the active charset
201
201
//
202
202
///////////////////////////////////////////////////////////
203
std::string charsetConversion::getIsoCharset()
203
std::string charsetConversion::getIsoCharset() const
204
204
{
205
205
	return m_isoCharset;
206
206
}
@@ -211,7 +211,7 @@ std::string charsetConversion::getIsoCha
211
211
// Convert a string from unicode to multibyte
212
212
//
213
213
///////////////////////////////////////////////////////////
214
std::string charsetConversion::fromUnicode(std::wstring unicodeString)
214
std::string charsetConversion::fromUnicode(const std::wstring& unicodeString) const
215
215
{
216
216
	PUNTOEXE_FUNCTION_START(L"charsetConversion::fromUnicode");
217
217
@@ -243,7 +243,7 @@ std::string charsetConversion::fromUnico
243
243
// Convert a string from multibyte to unicode
244
244
//
245
245
///////////////////////////////////////////////////////////
246
std::wstring charsetConversion::toUnicode(std::string asciiString)
246
std::wstring charsetConversion::toUnicode(const std::string& asciiString) const
247
247
{
248
248
	PUNTOEXE_FUNCTION_START(L"charsetConversion::toUnicode");
249
249

Up to file-list project_files/base/src/exception.cpp:

@@ -111,7 +111,7 @@ exceptionsManager* exceptionsManager::ge
111
111
///////////////////////////////////////////////////////////
112
112
// Construct the exceptionInfo object
113
113
///////////////////////////////////////////////////////////
114
exceptionInfo::exceptionInfo(std::wstring functionName, std::string fileName, long lineNumber, std::string exceptionType, std::string exceptionMessage):
114
exceptionInfo::exceptionInfo(const std::wstring& functionName, const std::string& fileName, const long lineNumber, const std::string& exceptionType, const std::string& exceptionMessage):
115
115
	m_functionName(functionName), 
116
116
	m_fileName(fileName),
117
117
	m_lineNumber(lineNumber),

Up to file-list project_files/base/src/huffmanTable.cpp:

13
13
#include "../include/streamWriter.h"
14
14
15
15
#include <list>
16
#include <string.h>
16
#include <string.h>
17
17
18
18
namespace puntoexe
19
19
{
@@ -280,64 +280,64 @@ bool huffmanTable::readHuffmanCode(imbxU
280
280
	// Buffer with the original huffman code
281
281
	///////////////////////////////////////////////////////////
282
282
	imbxUint32 readBuffer(0);
283
284
	// Used to add multiple bits to the read buffer
285
	///////////////////////////////////////////////////////////
283
284
	// Used to add multiple bits to the read buffer
285
	///////////////////////////////////////////////////////////
286
286
    imbxUint32 addBitsReadBuffer(0);
287
287
288
288
	// Active ordered value
289
289
	///////////////////////////////////////////////////////////
290
	imbxUint32 orderedValue(0);
291
292
	// Number of bits to read in one go
293
	///////////////////////////////////////////////////////////
290
	imbxUint32 orderedValue(0);
291
292
	// Number of bits to read in one go
293
	///////////////////////////////////////////////////////////
294
294
	imbxUint8 missingBits(0);
295
295
296
296
	// Scan all the codes sizes
297
297
	///////////////////////////////////////////////////////////
298
298
	for(imbxUint8 scanSize(1); scanSize<sizeof(m_valuesPerLength)/sizeof(m_valuesPerLength[0]); ++scanSize)
299
	{
300
        ++missingBits;
301
302
		// If the active length is empty, then continue the loop
303
		///////////////////////////////////////////////////////////
304
		if(m_valuesPerLength[scanSize] == 0)
305
		{
306
			continue;
307
		}
308
309
		// Read the missing bits
310
		///////////////////////////////////////////////////////////
311
		if(missingBits == scanSize) // Nothing in the buffer yet, we don't need to shift
312
		{
313
		    if(!pStream->readBits(&readBuffer, scanSize))
314
		    {
315
		        return false;
316
		    }
317
		}
318
		else
319
		{
320
		    if(missingBits == 1)
321
		    {
322
                if(!pStream->addBit(&readBuffer))
323
                {
324
                    return false;
325
                }
326
		    }
327
		    else
328
		    {
329
                if(!pStream->readBits(&addBitsReadBuffer, missingBits))
330
                {
331
                    return false;
332
                }
333
		        readBuffer <<= missingBits;
334
		        readBuffer |= addBitsReadBuffer;
335
		    }
336
		}
337
338
		// Reset the number of bits to read in one go
339
		///////////////////////////////////////////////////////////
340
		missingBits = 0;
299
	{
300
        ++missingBits;
301
302
		// If the active length is empty, then continue the loop
303
		///////////////////////////////////////////////////////////
304
		if(m_valuesPerLength[scanSize] == 0)
305
		{
306
			continue;
307
		}
308
309
		// Read the missing bits
310
		///////////////////////////////////////////////////////////
311
		if(missingBits == scanSize) // Nothing in the buffer yet, we don't need to shift
312
		{
313
		    if(!pStream->readBits(&readBuffer, scanSize))
314
		    {
315
		        return false;
316
		    }
317
		}
318
		else
319
		{
320
		    if(missingBits == 1)
321
		    {
322
                if(!pStream->addBit(&readBuffer))
323
                {
324
                    return false;
325
                }
326
		    }
327
		    else
328
		    {
329
                if(!pStream->readBits(&addBitsReadBuffer, missingBits))
330
                {
331
                    return false;
332
                }
333
		        readBuffer <<= missingBits;
334
		        readBuffer |= addBitsReadBuffer;
335
		    }
336
		}
337
338
		// Reset the number of bits to read in one go
339
		///////////////////////////////////////////////////////////
340
		missingBits = 0;
341
341
342
342
		// Validate the current Huffman code. If it's OK, then
343
343
		//  return the ordered value
@@ -367,7 +367,7 @@ bool huffmanTable::readHuffmanCode(imbxU
367
367
//
368
368
///////////////////////////////////////////////////////////
369
369
///////////////////////////////////////////////////////////
370
void huffmanTable::writeHuffmanCode(imbxUint32* pBuffer, streamWriter* pStream)
370
void huffmanTable::writeHuffmanCode(const imbxUint32* pBuffer, streamWriter* pStream)
371
371
{
372
372
	PUNTOEXE_FUNCTION_START(L"huffmanTable::writeHuffmanCode");
373
373

Up to file-list project_files/base/src/memory.cpp:

@@ -50,7 +50,7 @@ memory::memory():
50
50
//
51
51
///////////////////////////////////////////////////////////
52
52
///////////////////////////////////////////////////////////
53
void memory::transfer(ptr<memory> transferFrom)
53
void memory::transfer(const ptr<memory>& transferFrom)
54
54
{
55
55
	m_pMemoryBuffer.reset(transferFrom->m_pMemoryBuffer.release());
56
56
}
@@ -65,7 +65,7 @@ void memory::transfer(ptr<memory> transf
65
65
//
66
66
///////////////////////////////////////////////////////////
67
67
///////////////////////////////////////////////////////////
68
void memory::copyFrom(ptr<memory> sourceMemory)
68
void memory::copyFrom(const ptr<memory>& sourceMemory)
69
69
{
70
70
	if(m_pMemoryBuffer.get() == 0)
71
71
	{
@@ -193,7 +193,7 @@ bool memory::empty()
193
193
//
194
194
///////////////////////////////////////////////////////////
195
195
///////////////////////////////////////////////////////////
196
void memory::assign(imbxUint8* pSource, imbxUint32 sourceLength)
196
void memory::assign(const imbxUint8* pSource, const imbxUint32 sourceLength)
197
197
{
198
198
	if(m_pMemoryBuffer.get() == 0)
199
199
	{
@@ -423,4 +423,4 @@ memory* memoryPool::getMemory(imbxUint32
423
423
	return pMemory;
424
424
}
425
425
426
} // namespace puntoexe
426
} // namespace puntoexe

Up to file-list project_files/base/src/memoryStream.cpp:

9
9
10
10
#include "../include/exception.h"
11
11
#include "../include/memoryStream.h"
12
#include <string.h>
12
#include <string.h>
13
13
14
14
namespace puntoexe
15
15
{
@@ -51,7 +51,7 @@ memoryStream::memoryStream(ptr<memory> m
51
51
//
52
52
///////////////////////////////////////////////////////////
53
53
///////////////////////////////////////////////////////////
54
void memoryStream::write(imbxUint32 startPosition, imbxUint8* pBuffer, imbxUint32 bufferLength)
54
void memoryStream::write(imbxUint32 startPosition, const imbxUint8* pBuffer, imbxUint32 bufferLength)
55
55
{
56
56
	PUNTOEXE_FUNCTION_START(L"memoryStream::write");
57
57

Up to file-list project_files/base/src/stream.cpp:

@@ -56,7 +56,7 @@ stream::~stream()
56
56
//
57
57
///////////////////////////////////////////////////////////
58
58
///////////////////////////////////////////////////////////
59
void stream::openFile(std::string fileName, int mode)
59
void stream::openFile(const std::string& fileName, const int mode)
60
60
{
61
61
	PUNTOEXE_FUNCTION_START(L"stream::openFile (ansi)");
62
62
@@ -82,7 +82,7 @@ void stream::openFile(std::string fileNa
82
82
//
83
83
///////////////////////////////////////////////////////////
84
84
///////////////////////////////////////////////////////////
85
void stream::openFile(std::wstring fileName, int mode)
85
void stream::openFile(const std::wstring& fileName, const int mode)
86
86
{
87
87
	PUNTOEXE_FUNCTION_START(L"stream::openFile (unicode)");
88
88
	if(m_openFile)
@@ -161,7 +161,7 @@ void stream::openFile(std::wstring fileN
161
161
//
162
162
///////////////////////////////////////////////////////////
163
163
///////////////////////////////////////////////////////////
164
void stream::write(imbxUint32 startPosition, imbxUint8* pBuffer, imbxUint32 bufferLength)
164
void stream::write(imbxUint32 startPosition, const imbxUint8* pBuffer, imbxUint32 bufferLength)
165
165
{
166
166
	PUNTOEXE_FUNCTION_START(L"stream::write");
167
167

Up to file-list project_files/base/src/streamWriter.cpp:

7
7
8
8
*/
9
9
10
#include "../include/streamWriter.h"
10
#include "../include/streamWriter.h"
11
11
#include <string.h>
12
12
13
13
namespace puntoexe
@@ -19,7 +19,7 @@ namespace puntoexe
19
19
//
20
20
///////////////////////////////////////////////////////////
21
21
streamWriter::streamWriter(ptr<baseStream> pControlledStream, imbxUint32 virtualStart /* =0 */, imbxUint32 virtualLength /* =0 */):
22
	streamController(pControlledStream, virtualStart, virtualLength),
22
	streamController(pControlledStream, virtualStart, virtualLength),
23
23
	m_outBitsBuffer(0),
24
24
	m_outBitsNum(0)
25
25
{
@@ -60,7 +60,7 @@ void streamWriter::flushDataBuffer()
60
60
// Write into the stream
61
61
//
62
62
///////////////////////////////////////////////////////////
63
void streamWriter::write(imbxUint8* pBuffer, imbxUint32 bufferLength)
63
void streamWriter::write(const imbxUint8* pBuffer, imbxUint32 bufferLength)
64
64
{
65
65
	while(bufferLength != 0)
66
66
	{

Up to file-list project_files/examples/dicom2jpeg/nbproject/project.xml:

6
6
            <name>dicom2jpeg</name>
7
7
            <make-project-type>0</make-project-type>
8
8
            <make-dep-projects/>
9
            <c-extensions/>
10
            <cpp-extensions>cpp</cpp-extensions>
11
            <header-extensions>h</header-extensions>
9
12
        </data>
10
13
    </configuration>
11
14
</project>

Up to file-list project_files/imebra/include/LUT.h:

@@ -53,7 +53,7 @@ public:
53
53
		m_firstMapped(0),
54
54
		m_bits(0),
55
55
		m_bChecked(false),
56
		m_bValid(false),
56
		m_bValid(false),
57
57
		m_pMappedValues(0){}
58
58
59
59

Up to file-list project_files/imebra/include/buffer.h:

@@ -88,7 +88,7 @@ public:
88
88
	///                      two uppercase chars
89
89
	///
90
90
	///////////////////////////////////////////////////////////
91
	buffer(ptr<baseObject> externalLock, std::string defaultType="");
91
	buffer(const ptr<baseObject>& externalLock, const std::string& defaultType="");
92
92
93
93
	/// \brief Constructor. Initialize the buffer object and
94
94
	///         declare the buffer's content on demand.
@@ -118,9 +118,9 @@ public:
118
118
	/// @param endianType   the stream's endian type
119
119
	///
120
120
	///////////////////////////////////////////////////////////
121
	buffer(ptr<baseObject> externalLock, 
122
		std::string defaultType,
123
		ptr<baseStream> originalStream,
121
	buffer(const ptr<baseObject>& externalLock,
122
		const std::string& defaultType,
123
		const ptr<baseStream>& originalStream,
124
124
		imbxUint32 bufferPosition,
125
125
		imbxUint32 bufferLength,
126
126
		imbxUint32 wordLength,

Up to file-list project_files/imebra/include/charsetsList.h:

@@ -43,8 +43,8 @@ typedef std::list<std::wstring> tCharset
43
43
///////////////////////////////////////////////////////////
44
44
///////////////////////////////////////////////////////////
45
45
46
void updateCharsets(tCharsetsList* pCharsetsList, tCharsetsList* pDestinationCharsetsList);
47
void copyCharsets(tCharsetsList* pSourceCharsetsList, tCharsetsList* pDestinationCharsetsList);
46
void updateCharsets(const tCharsetsList* pCharsetsList, tCharsetsList* pDestinationCharsetsList);
47
void copyCharsets(const tCharsetsList* pSourceCharsetsList, tCharsetsList* pDestinationCharsetsList);
48
48
49
49
///////////////////////////////////////////////////////////
50
50
///////////////////////////////////////////////////////////

Up to file-list project_files/imebra/include/dataHandler.h:

@@ -142,7 +142,7 @@ public:
142
142
	/// @param elementNumber The element number to activate.
143
143
	///
144
144
	///////////////////////////////////////////////////////////
145
	virtual void setPointer(imbxUint32 elementNumber) =0;
145
	virtual void setPointer(const imbxUint32 elementNumber) =0;
146
146
147
147
	/// \brief Increase the internal pointer by one element.
148
148
	///
@@ -165,7 +165,7 @@ public:
165
165
	///             current value of the data handler's
166
166
	///             internal pointer
167
167
	///////////////////////////////////////////////////////////
168
	virtual void skip(int skip);
168
	virtual void skip(const int skip);
169
169
170
170
	/// \brief Returns true if the data handler's internal
171
171
	///        pointer is valid.
@@ -182,7 +182,7 @@ public:
182
182
	///         false=invalid).
183
183
	///
184
184
	///////////////////////////////////////////////////////////
185
	virtual bool pointerIsValid() =0;
185
	virtual bool pointerIsValid() const=0;
186
186
187
187
	//@}
188
188
@@ -202,7 +202,7 @@ public:
202
202
	///                        in data elements
203
203
	///
204
204
	///////////////////////////////////////////////////////////
205
	virtual void setSize(imbxUint32 elementsNumber) =0;
205
	virtual void setSize(const imbxUint32 elementsNumber) =0;
206
206
207
207
	/// \brief Retrieve the data handler's local buffer buffer
208
208
	///         size (in elements).
@@ -210,7 +210,7 @@ public:
210
210
	/// @return the buffer's size in elements
211
211
	///
212
212
	///////////////////////////////////////////////////////////
213
	virtual imbxUint32 getSize() =0;
213
	virtual imbxUint32 getSize() const=0;
214
214
215
215
	/// \brief Returns a single element's size in bytes.
216
216
	///
@@ -221,7 +221,7 @@ public:
221
221
	///         element doesn't have a fixed size
222
222
	///
223
223
	///////////////////////////////////////////////////////////
224
	virtual imbxUint32 getUnitSize() =0;
224
	virtual imbxUint32 getUnitSize() const=0;
225
225
226
226
	//@}
227
227
	
@@ -240,7 +240,7 @@ public:
240
240
	///                      \ref buffer
241
241
	///
242
242
	///////////////////////////////////////////////////////////
243
	virtual void parseBuffer(ptr<memory> memoryBuffer)=0;
243
	virtual void parseBuffer(const ptr<memory>& memoryBuffer)=0;
244
244
	
245
245
	/// \internal
246
246
	/// \brief This function copies the %data from the 
@@ -252,7 +252,7 @@ public:
252
252
	///                 pBuffer
253
253
	///
254
254
	///////////////////////////////////////////////////////////
255
	void parseBuffer(imbxUint8* pBuffer, imbxUint32 bufferLength);
255
	void parseBuffer(const imbxUint8* pBuffer, const imbxUint32 bufferLength);
256
256
257
257
	/// \internal
258
258
	/// \brief Copies the local %buffer into the original
@@ -262,7 +262,7 @@ public:
262
262
	///                      \ref buffer
263
263
	///
264
264
	///////////////////////////////////////////////////////////
265
	virtual void buildBuffer(ptr<memory> memoryBuffer)=0;
265
	virtual void buildBuffer(const ptr<memory>& memoryBuffer)=0;
266
266
267
267
	/// \internal
268
268
	/// \brief Defines the charsets used in the string
@@ -279,7 +279,7 @@ public:
279
279
	///                      dicom charsets used in the string
280
280
	///
281
281
	///////////////////////////////////////////////////////////
282
	virtual void getCharsetsList(charsetsList::tCharsetsList* pCharsetsList);
282
	virtual void getCharsetsList(charsetsList::tCharsetsList* pCharsetsList) const;
283
283
284
284
	//@}
285
285
@@ -299,7 +299,7 @@ public:
299
299
	/// @return the data handler's dicom data type
300
300
	///
301
301
	///////////////////////////////////////////////////////////
302
	std::string getDataType();
302
	std::string getDataType() const;
303
303
304
304
	/// \brief Return the byte that this handler uses to fill
305
305
	///         its content to make its size even.
@@ -307,7 +307,7 @@ public:
307
307
	/// @return the byte used to make the content's size even
308
308
	///
309
309
	///////////////////////////////////////////////////////////
310
	virtual imbxUint8 getPaddingByte();
310
	virtual imbxUint8 getPaddingByte() const;
311
311
312
312
	//@}
313
313
@@ -329,7 +329,7 @@ public:
329
329
	///          transformed into a signed long
330
330
	///
331
331
	///////////////////////////////////////////////////////////
332
	virtual imbxInt32 getSignedLong() =0;
332
	virtual imbxInt32 getSignedLong() const=0;
333
333
334
334
	/// \brief Retrieve the active %data element as an unsigned
335
335
	///         long.
@@ -342,7 +342,7 @@ public:
342
342
	///          transformed into an unsigned long
343
343
	///
344
344
	///////////////////////////////////////////////////////////
345
	virtual imbxUint32 getUnsignedLong() =0;
345
	virtual imbxUint32 getUnsignedLong() const =0;
346
346
347
347
	/// \brief Retrieve the active %data element as a double.
348
348
	///
@@ -354,7 +354,7 @@ public:
354
354
	///          transformed into a double
355
355
	///
356
356
	///////////////////////////////////////////////////////////
357
	virtual double getDouble() =0;
357
	virtual double getDouble() const=0;
358
358
359
359
	/// \brief Retrieve the active %data element as a signed
360
360
	///         long and increase the %data handler's internal
@@ -414,7 +414,7 @@ public:
414
414
	///         transformed into a string.
415
415
	///
416
416
	///////////////////////////////////////////////////////////
417
	virtual std::string getString() = 0;
417
	virtual std::string getString() const= 0;
418
418
419
419
	/// \brief Retrieve the active %data element as an
420
420
	///         unicode string.
@@ -431,7 +431,7 @@ public:
431
431
	///         transformed into a string.
432
432
	///
433
433
	///////////////////////////////////////////////////////////
434
	virtual std::wstring getUnicodeString() = 0;
434
	virtual std::wstring getUnicodeString() const = 0;
435
435
436
436
	/// \brief Retrieve the active %data element as a date.
437
437
	///
@@ -470,7 +470,7 @@ public:
470
470
		imbxInt32* pSeconds,
471
471
		imbxInt32* pNanoseconds,
472
472
		imbxInt32* pOffsetHours,
473
		imbxInt32* pOffsetMinutes);
473
		imbxInt32* pOffsetMinutes) const;
474
474
475
475
	/// \brief Set the active %data element as a date.
476
476
	///
@@ -513,7 +513,7 @@ public:
513
513
	///				  %data element.
514
514
	///
515
515
	///////////////////////////////////////////////////////////
516
	virtual void setSignedLong(imbxInt32 value) =0;
516
	virtual void setSignedLong(const imbxInt32 value) =0;
517
517
518
518
	/// \brief Set the active %data element from an unsigned
519
519
	///        long.
@@ -526,7 +526,7 @@ public:
526
526
	///				  %data element.
527
527
	///
528
528
	///////////////////////////////////////////////////////////
529
	virtual void setUnsignedLong(imbxUint32 value) =0;
529
	virtual void setUnsignedLong(const imbxUint32 value) =0;
530
530
531
531
	/// \brief Set the active %data element from a double
532
532
	///
@@ -538,7 +538,7 @@ public:
538
538
	///				  %data element.
539
539
	///
540
540
	///////////////////////////////////////////////////////////
541
	virtual void setDouble(double value) =0;
541
	virtual void setDouble(const double value) =0;
542
542
543
543
	/// \brief Set the active %data element from a signed
544
544
	///         long and increase the data handler's internal
@@ -552,7 +552,7 @@ public:
552
552
	///				  %data element.
553
553
	///
554
554
	///////////////////////////////////////////////////////////
555
	virtual void setSignedLongIncPointer(imbxInt32 value);
555
	virtual void setSignedLongIncPointer(const imbxInt32 value);
556
556
557
557
	/// \brief Set the active %data element from an unsigned
558
558
	///         long and increase the data handler's internal
@@ -566,7 +566,7 @@ public:
566
566
	///				  %data element.
567
567
	///
568
568
	///////////////////////////////////////////////////////////
569
	virtual void setUnsignedLongIncPointer(imbxUint32 value);
569
	virtual void setUnsignedLongIncPointer(const imbxUint32 value);
570
570
571
571
	/// \brief Set the active %data element from a double
572
572
	///         and increase the data handler's internal
@@ -580,7 +580,7 @@ public:
580
580
	///				  %data element.
581
581
	///
582
582
	///////////////////////////////////////////////////////////
583
	virtual void setDoubleIncPointer(double value);
583
	virtual void setDoubleIncPointer(const double value);
584
584
585
585
	/// \brief Set the active %data element from a string.
586
586
	///        SetUnicodeString() is preferred over 
@@ -593,7 +593,7 @@ public:
593
593
	/// @param value the value to write into the active
594
594
	///				  %data element.
595
595
	///////////////////////////////////////////////////////////
596
	virtual void setString(std::string value) =0;
596
	virtual void setString(const std::string& value) =0;
597
597
598
598
	/// \brief Set the active %data element from an unicode
599
599
	///          string.
@@ -608,7 +608,7 @@ public:
608
608
	/// @param value the value to write into the active
609
609
	///				  %data element.
610
610
	///////////////////////////////////////////////////////////
611
	virtual void setUnicodeString(std::wstring value) =0;
611
	virtual void setUnicodeString(const std::wstring& value) =0;
612
612
613
613
	//@}
614
614
@@ -635,7 +635,7 @@ public:
635
635
	///                      handler.
636
636
	///
637
637
	///////////////////////////////////////////////////////////
638
	virtual void copyFromInt32(imbxInt32* pSource, imbxUint32 length);
638
	virtual void copyFromInt32(const imbxInt32* pSource, const imbxUint32 length) = 0;
639
639
	
640
640
	/// \brief Copy the content of the %buffer controlled by
641
641
	///         the handler into an array of imbxInt32 values.
@@ -646,7 +646,7 @@ public:
646
646
	///                      copy into the destination array
647
647
	///
648
648
	///////////////////////////////////////////////////////////
649
	virtual void copyToInt32(imbxInt32* pDest, imbxUint32 length);
649
	virtual void copyToInt32(imbxInt32* pDest, const imbxUint32 length) const = 0;
650
650
	
651
651
	//@}
652
652

Up to file-list project_files/imebra/include/dataHandlerDate.h:

@@ -39,7 +39,7 @@ namespace handlers
39
39
class dataHandlerDate : public dataHandlerDateTimeBase
40
40
{
41
41
public:
42
	virtual imbxUint32 getUnitSize();
42
	virtual imbxUint32 getUnitSize() const;
43
43
44
44
	virtual void getDate(
45
45
		imbxInt32* pYear, 
@@ -50,7 +50,7 @@ public:
50
50
		imbxInt32* pSeconds,
51
51
		imbxInt32* pNanoseconds,
52
52
		imbxInt32* pOffsetHours,
53
		imbxInt32* pOffsetMinutes);
53
		imbxInt32* pOffsetMinutes) const;
54
54
55
55
	virtual void setDate(
56
56
		imbxInt32 year, 
@@ -76,7 +76,7 @@ public:
76
76
	///          buffer
77
77
	///
78
78
	///////////////////////////////////////////////////////////
79
	virtual std::wstring getUnicodeString();
79
	virtual std::wstring getUnicodeString() const;
80
80
81
81
	/// \brief Set the date from a string.
82
82
	///
@@ -89,12 +89,12 @@ public:
89
89
	/// @param value the string representing the date to be set
90
90
	///
91
91
	///////////////////////////////////////////////////////////
92
	virtual void setUnicodeString(std::wstring value);
92
	virtual void setUnicodeString(const std::wstring& value);
93
93
94
	void parseBuffer(ptr<memory> memoryBuffer);
94
	void parseBuffer(const ptr<memory>& memoryBuffer);
95
95
96
96
protected:
97
	virtual imbxUint32 maxSize();
97
	virtual imbxUint32 maxSize() const;
98
98
};
99
99
100
100
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerDateTime.h:

@@ -40,7 +40,7 @@ public:
40
40
		imbxInt32* pSeconds,
41
41
		imbxInt32* pNanoseconds,
42
42
		imbxInt32* pOffsetHours,
43
		imbxInt32* pOffsetMinutes);
43
		imbxInt32* pOffsetMinutes) const;
44
44
45
45
	virtual void setDate(
46
46
		imbxInt32 year, 
@@ -71,7 +71,7 @@ public:
71
71
	///          buffer
72
72
	///
73
73
	///////////////////////////////////////////////////////////
74
	virtual std::wstring getUnicodeString();
74
	virtual std::wstring getUnicodeString() const;
75
75
76
76
	/// \brief Set the date from a string.
77
77
	///
@@ -89,12 +89,12 @@ public:
89
89
	/// @param value the string representing the date to be set
90
90
	///
91
91
	///////////////////////////////////////////////////////////
92
	virtual void setUnicodeString(std::wstring value);
92
	virtual void setUnicodeString(const std::wstring& value);
93
93
94
	virtual imbxUint32 getUnitSize();
94
	virtual imbxUint32 getUnitSize() const;
95
95
96
96
protected:
97
	virtual imbxUint32 maxSize();
97
	virtual imbxUint32 maxSize() const;
98
98
};
99
99
100
100
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerDateTimeBase.h:

@@ -42,35 +42,35 @@ namespace handlers
42
42
class dataHandlerDateTimeBase : public dataHandlerString {
43
43
44
44
public:
45
	virtual imbxInt32 getSignedLong();
46
	virtual imbxUint32 getUnsignedLong();
47
	virtual double getDouble();
48
	virtual void setSignedLong(imbxInt32 value);
49
	virtual void setUnsignedLong(imbxUint32 value);
50
	virtual void setDouble(double value);
45
	virtual imbxInt32 getSignedLong() const;
46
	virtual imbxUint32 getUnsignedLong() const;
47
	virtual double getDouble() const;
48
	virtual void setSignedLong(const imbxInt32 value);
49
	virtual void setUnsignedLong(const imbxUint32 value);
50
	virtual void setDouble(const double value);
51
51
52
52
protected:
53
	virtual wchar_t getSeparator();
53
	virtual wchar_t getSeparator() const;
54
54
55
55
	void parseDate(
56
		std::wstring dateString, 		
56
		std::wstring dateString,
57
57
		imbxInt32* pYear, 
58
58
		imbxInt32* pMonth, 
59
		imbxInt32* pDay);
59
		imbxInt32* pDay) const;
60
60
61
61
	std::wstring buildDate(
62
62
		imbxUint32 year,
63
63
		imbxUint32 month,
64
		imbxUint32 day);
64
		imbxUint32 day) const;
65
65
	
66
66
	void parseTime(
67
		std::wstring timeString, 		
67
		std::wstring timeString,
68
68
		imbxInt32* pHour, 
69
69
		imbxInt32* pMinutes,
70
70
		imbxInt32* pSeconds,
71
71
		imbxInt32* pNanoseconds,
72
72
		imbxInt32* pOffsetHours,
73
		imbxInt32* pOffsetMinutes);
73
		imbxInt32* pOffsetMinutes) const;
74
74
75
75
	std::wstring buildTime(
76
76
		imbxInt32 hour,
@@ -79,10 +79,10 @@ protected:
79
79
		imbxInt32 nanoseconds,
80
80
		imbxInt32 offsetHours,
81
81
		imbxInt32 offsetMinutes
82
		);
82
		) const;
83
83
84
	void split(std::wstring timeString, std::wstring separators, std::vector<std::wstring> *pComponents);
85
	std::wstring padLeft(std::wstring source, std::wstring fillChar, size_t length);
84
	void split(const std::wstring& timeString, const std::wstring& separators, std::vector<std::wstring> *pComponents) const;
85
	std::wstring padLeft(const std::wstring& source, const wchar_t fillChar, const size_t length) const;
86
86
};
87
87
88
88
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerNumeric.h:

@@ -78,14 +78,14 @@ public:
78
78
	// Returns the size of an element managed by the
79
79
	//  handler.
80
80
	///////////////////////////////////////////////////////////
81
	virtual imbxUint32 getUnitSize()
81
	virtual imbxUint32 getUnitSize() const
82
82
	{
83
83
		return sizeof(dataHandlerType);
84
84
	}
85
85
86
86
	// Set the data element's pointer
87
87
	///////////////////////////////////////////////////////////
88
	virtual void setPointer(imbxUint32 elementNumber)
88
	virtual void setPointer(const imbxUint32 elementNumber)
89
89
	{
90
90
		if(m_pMemoryString == 0 || elementNumber >= getSize())
91
91
		{
@@ -103,7 +103,7 @@ public:
103
103
104
104
	// Returns true if the pointer is valid
105
105
	///////////////////////////////////////////////////////////
106
	virtual bool pointerIsValid()
106
	virtual bool pointerIsValid() const
107
107
	{
108
108
		return m_elementPointer != 0 && m_elementPointer < (dataHandlerType*)m_pMemoryStringEnd;
109
109
	}
@@ -111,28 +111,28 @@ public:
111
111
	// Increase the data element's pointer by the specified
112
112
	//  amount of steps
113
113
	///////////////////////////////////////////////////////////
114
	virtual void skip(int skip)
114
	virtual void skip(const int skip)
115
115
	{
116
		m_elementPointer+=skip;
116
		m_elementPointer += skip;
117
117
	}
118
118
119
119
	// Retrieve the data element as a signed long
120
120
	///////////////////////////////////////////////////////////
121
	virtual imbxInt32 getSignedLong()
121
	virtual imbxInt32 getSignedLong() const
122
122
	{
123
123
		return (imbxInt32) (*m_elementPointer);
124
124
	}
125
125
126
126
	// Retrieve the data element an unsigned long
127
127
	///////////////////////////////////////////////////////////
128
	virtual imbxUint32 getUnsignedLong()
128
	virtual imbxUint32 getUnsignedLong() const
129
129
	{
130
130
		return (imbxUint32) (*m_elementPointer);
131
131
	}
132
132
133
133
	// Retrieve the data element as a double
134
134
	///////////////////////////////////////////////////////////
135
	virtual double getDouble()
135
	virtual double getDouble() const
136
136
	{
137
137
		return (double) (*m_elementPointer);
138
138
	}
@@ -163,7 +163,7 @@ public:
163
163
164
164
	// Retrieve the data element as a string
165
165
	///////////////////////////////////////////////////////////
166
	virtual std::string getString()
166
	virtual std::string getString() const
167
167
	{
168
168
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::getString");
169
169
@@ -176,7 +176,7 @@ public:
176
176
177
177
	// Retrieve the data element as a unicode string
178
178
	///////////////////////////////////////////////////////////
179
	virtual std::wstring getUnicodeString()
179
	virtual std::wstring getUnicodeString() const
180
180
	{
181
181
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::getUnicodeString");
182
182
@@ -189,7 +189,7 @@ public:
189
189
190
190
	// Retrieve the buffer's size in elements
191
191
	///////////////////////////////////////////////////////////
192
	virtual imbxUint32 getSize()
192
	virtual imbxUint32 getSize() const
193
193
	{
194
194
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::getSize");
195
195
@@ -200,21 +200,21 @@ public:
200
200
201
201
	// Set the data element as a signed long
202
202
	///////////////////////////////////////////////////////////
203
	virtual void setSignedLong(imbxInt32 value)
203
	virtual void setSignedLong(const imbxInt32 value)
204
204
	{
205
205
		*m_elementPointer = (dataHandlerType)value;
206
206
	}
207
207
208
208
	// Set the data element as an unsigned long
209
209
	///////////////////////////////////////////////////////////
210
	virtual void setUnsignedLong(imbxUint32 value)
210
	virtual void setUnsignedLong(const imbxUint32 value)
211
211
	{
212
212
		*m_elementPointer = (dataHandlerType)value;
213
213
	}
214
214
215
215
	// Set the data element as a double
216
216
	///////////////////////////////////////////////////////////
217
	virtual void setDouble(double value)
217
	virtual void setDouble(const double value)
218
218
	{
219
219
		*m_elementPointer = (dataHandlerType)value;
220
220
	}
@@ -222,7 +222,7 @@ public:
222
222
	// Set the data element as a signed long and increase the
223
223
	//  data element's pointer
224
224
	///////////////////////////////////////////////////////////
225
	virtual void setSignedLongIncPointer(imbxInt32 value)
225
	virtual void setSignedLongIncPointer(const imbxInt32 value)
226
226
	{
227
227
		*(m_elementPointer++) = (dataHandlerType)value;
228
228
	}
@@ -230,7 +230,7 @@ public:
230
230
	// Set the data element as an unsigned long and increase
231
231
	//  the data element's pointer
232
232
	///////////////////////////////////////////////////////////
233
	virtual void setUnsignedLongIncPointer(imbxUint32 value)
233
	virtual void setUnsignedLongIncPointer(const imbxUint32 value)
234
234
	{
235
235
		*(m_elementPointer++) = (dataHandlerType)value;
236
236
	}
@@ -238,14 +238,14 @@ public:
238
238
	// Set the data element as a double and increase the data
239
239
	//  element's pointer
240
240
	///////////////////////////////////////////////////////////
241
	virtual void setDoubleIncPointer(double value)
241
	virtual void setDoubleIncPointer(const double value)
242
242
	{
243
243
		*(m_elementPointer++) = (dataHandlerType)value;
244
244
	}
245
245
246
246
	// Set the data element as a string
247
247
	///////////////////////////////////////////////////////////
248
	virtual void setString(std::string value)
248
	virtual void setString(const std::string& value)
249
249
	{
250
250
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::setString");
251
251
@@ -259,7 +259,7 @@ public:
259
259
260
260
	// Set the data element as an unicode string
261
261
	///////////////////////////////////////////////////////////
262
	virtual void setUnicodeString(std::wstring value)
262
	virtual void setUnicodeString(const std::wstring& value)
263
263
	{
264
264
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::setUnicodeString");
265
265
@@ -281,7 +281,7 @@ public:
281
281
	///          the data managed by the handler
282
282
	///
283
283
	///////////////////////////////////////////////////////////
284
	dataHandlerType* getMemoryBuffer()
284
	dataHandlerType* getMemoryBuffer() const
285
285
	{
286
286
		return m_pMemoryString;
287
287
	}
@@ -301,7 +301,7 @@ public:
301
301
	// Copy the data from an array of imbxInt32 values
302
302
	//  into the memory managed by the handler.
303
303
	///////////////////////////////////////////////////////////
304
	virtual void copyFromInt32(imbxInt32* pSource, imbxUint32 length)
304
	virtual void copyFromInt32(const imbxInt32* pSource, const imbxUint32 length)
305
305
	{
306
306
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::copyFromInt32");
307
307
@@ -322,7 +322,7 @@ public:
322
322
	// Copy the data from the handler into an array of
323
323
	//  imbxInt32 values
324
324
	///////////////////////////////////////////////////////////
325
	virtual void copyToInt32(imbxInt32* pDest, imbxUint32 length)
325
	virtual void copyToInt32(imbxInt32* pDest, const imbxUint32 length) const
326
326
	{
327
327
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::copyToInt32");
328
328
@@ -377,7 +377,7 @@ public:
377
377
	///                      destination buffer
378
378
	///
379
379
	///////////////////////////////////////////////////////////
380
	virtual void copyFromInt32Interleaved(imbxInt32* pSource,
380
	virtual void copyFromInt32Interleaved(const imbxInt32* pSource,
381
381
		imbxUint32 sourceReplicateX,
382
382
		imbxUint32 sourceReplicateY,
383
383
		imbxUint32 destStartCol,
@@ -394,42 +394,42 @@ public:
394
394
			return;
395
395
		}
396
396
		dataHandlerType *pDestRowScan = &(m_pMemoryString[(destStartRow*destWidth+destStartCol)*destNumChannels+destStartChannel]);
397
		imbxInt32* pSourceRowScan = pSource;
397
		const imbxInt32* pSourceRowScan = pSource;
398
398
399
399
		imbxUint32 replicateXCount;
400
400
		imbxUint32 replicateYCount = sourceReplicateY;
401
401
		imbxUint32 replicateYIncrease = (destEndCol - destStartCol) / sourceReplicateX;
402
402
403
403
		dataHandlerType *pDestColScan;
404
		imbxInt32* pSourceColScan;
404
		const imbxInt32* pSourceColScan;
405
405
406
        if(destHeight < destEndRow)
407
        {
408
            destEndRow = destHeight;
409
        }
410
        if(destWidth < destEndCol)
411
        {
412
            destEndCol = destWidth;
413
        }
414
        imbxUint32 numColumns(destEndCol - destStartCol);
415
        imbxUint32 scanCol(0); // Used in the loop to scan the columns
416
406
        if(destHeight < destEndRow)
407
        {
408
            destEndRow = destHeight;
409
        }
410
        if(destWidth < destEndCol)
411
        {
412
            destEndCol = destWidth;
413
        }
414
        imbxUint32 numColumns(destEndCol - destStartCol);
415
        imbxUint32 scanCol(0); // Used in the loop to scan the columns
416
417
417
		for(imbxUint32 numYCopies(destEndRow - destStartRow); numYCopies != 0; --numYCopies)
418
418
		{
419
419
			pDestColScan = pDestRowScan;
420
420
			pSourceColScan = pSourceRowScan;
421
422
            if(sourceReplicateX == 1)
423
            {
424
                for(scanCol = numColumns; scanCol != 0; --scanCol)
425
                {
426
                    *pDestColScan = (dataHandlerType)(*(pSourceColScan++));
427
                    pDestColScan += destNumChannels;
428
                }
429
            }
430
            else
431
            {
432
                replicateXCount = sourceReplicateX;
421
422
            if(sourceReplicateX == 1)
423
            {
424
                for(scanCol = numColumns; scanCol != 0; --scanCol)
425
                {
426
                    *pDestColScan = (dataHandlerType)(*(pSourceColScan++));
427
                    pDestColScan += destNumChannels;
428
                }
429
            }
430
            else
431
            {
432
                replicateXCount = sourceReplicateX;
433
433
                for(scanCol = numColumns; scanCol != 0; --scanCol)
434
434
                {
435
435
                    *pDestColScan = (dataHandlerType)(*pSourceColScan);
@@ -439,7 +439,7 @@ public:
439
439
                        replicateXCount = sourceReplicateX;
440
440
                        ++pSourceColScan;
441
441
                    }
442
                }
442
                }
443
443
            }
444
444
			pDestRowScan += destWidth * destNumChannels;
445
445
			if(--replicateYCount == 0)
@@ -497,7 +497,7 @@ public:
497
497
		imbxUint32 sourceStartChannel,
498
498
		imbxUint32 sourceWidth,
499
499
		imbxUint32 sourceHeight,
500
		imbxUint32 sourceNumChannels)
500
		imbxUint32 sourceNumChannels) const
501
501
	{
502
502
		if(sourceStartCol >= sourceWidth || sourceStartRow >= sourceHeight)
503
503
		{
@@ -568,7 +568,7 @@ public:
568
568
569
569
	// Set the buffer's size, in data elements
570
570
	///////////////////////////////////////////////////////////
571
	virtual void setSize(imbxUint32 elementsNumber)
571
	virtual void setSize(const imbxUint32 elementsNumber)
572
572
	{
573
573
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::setSize");
574
574
@@ -582,7 +582,7 @@ public:
582
582
583
583
	// Parse the tag's buffer and extract its content
584
584
	///////////////////////////////////////////////////////////
585
	virtual void parseBuffer(ptr<memory> memoryBuffer)
585
	virtual void parseBuffer(const ptr<memory>& memoryBuffer)
586
586
	{
587
587
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::parseBuffer");
588
588
@@ -595,7 +595,7 @@ public:
595
595
596
596
	// Rebuild the tag's buffer
597
597
	///////////////////////////////////////////////////////////
598
	virtual void buildBuffer(ptr<memory> memoryBuffer)
598
	virtual void buildBuffer(const ptr<memory>& memoryBuffer)
599
599
	{
600
600
		PUNTOEXE_FUNCTION_START(L"dataHandlerNumeric::buildBuffer");
601
601

Up to file-list project_files/imebra/include/dataHandlerString.h:

@@ -46,7 +46,7 @@ public:
46
46
public:
47
47
	// Set the data element's pointer
48
48
	///////////////////////////////////////////////////////////
49
	virtual void setPointer(imbxUint32 elementNumber);
49
	virtual void setPointer(imbxUint32 const elementNumber);
50
50
51
51
	// Increase the data element's pointer
52
52
	///////////////////////////////////////////////////////////
@@ -54,82 +54,94 @@ public:
54
54
55
55
	// Returns true if the pointer is valid
56
56
	///////////////////////////////////////////////////////////
57
	virtual bool pointerIsValid();
57
	virtual bool pointerIsValid() const;
58
58
59
59
	// Get the data element as a signed long
60
60
	///////////////////////////////////////////////////////////
61
	virtual imbxInt32 getSignedLong();
61
	virtual imbxInt32 getSignedLong() const;
62
62
63
63
	// Get the data element as an unsigned long
64
64
	///////////////////////////////////////////////////////////
65
	virtual imbxUint32 getUnsignedLong();
65
	virtual imbxUint32 getUnsignedLong() const;
66
66
	
67
67
	// Get the data element as a double
68
68
	///////////////////////////////////////////////////////////
69
	virtual double getDouble();
69
	virtual double getDouble() const;
70
70
71
71
	// Get the data element as a string
72
72
	///////////////////////////////////////////////////////////
73
	virtual std::string getString();
73
	virtual std::string getString() const;
74
74
75
75
	// Get the data element as an unicode string
76
76
	///////////////////////////////////////////////////////////
77
	virtual std::wstring getUnicodeString();
77
	virtual std::wstring getUnicodeString() const;
78
78
79
79
	// Retrieve the data element as a string
80
80
	///////////////////////////////////////////////////////////
81
	virtual imbxUint32 getSize();
81
	virtual imbxUint32 getSize() const;
82
82
	
83
83
	// Set the data element as a signed long
84
84
	///////////////////////////////////////////////////////////
85
	virtual void setSignedLong(imbxInt32 value);
85
	virtual void setSignedLong(const imbxInt32 value);
86
86
	
87
87
	// Set the data element as an unsigned long
88
88
	///////////////////////////////////////////////////////////
89
	virtual void setUnsignedLong(imbxUint32 value);
89
	virtual void setUnsignedLong(const imbxUint32 value);
90
90
	
91
91
	// Set the data element as a double
92
92
	///////////////////////////////////////////////////////////
93
	virtual void setDouble(double value);
93
	virtual void setDouble(const double value);
94
94
	
95
95
	// Set the data element as a string
96
96
	///////////////////////////////////////////////////////////
97
	virtual void setString(std::string value);
97
	virtual void setString(const std::string& value);
98
98
99
99
	// Set the data element as an unicode string
100
100
	///////////////////////////////////////////////////////////
101
	virtual void setUnicodeString(std::wstring value);
101
	virtual void setUnicodeString(const std::wstring& value);
102
102
	
103
103
	// Set the buffer's size, in data elements
104
104
	///////////////////////////////////////////////////////////
105
	virtual void setSize(imbxUint32 elementsNumber);
105
	virtual void setSize(const imbxUint32 elementsNumber);
106
106
107
107
	// Parse the buffer
108
108
	///////////////////////////////////////////////////////////
109
	virtual void parseBuffer(ptr<memory> memoryBuffer);
109
	virtual void parseBuffer(const ptr<memory>& memoryBuffer);
110
110
111
111
	// Build the buffer
112
112
	///////////////////////////////////////////////////////////
113
	virtual void buildBuffer(ptr<memory> memoryBuffer);
113
	virtual void buildBuffer(const ptr<memory>& memoryBuffer);
114
115
	// Copy the content of an array of imbxInt32 values
116
	//         into the buffer controlled by the handler.
117
	///////////////////////////////////////////////////////////
118
	virtual void copyFromInt32(const imbxInt32* pSource, const imbxUint32 length);
119
120
	// Copy the content of the buffer to an array of imbxInt32
121
	//         values.
122
	///////////////////////////////////////////////////////////
123
	///////////////////////////////////////////////////////////
124
	virtual void copyToInt32(imbxInt32* pDest, const imbxUint32 length) const;
125
114
126
115
127
protected:
116
128
	// Convert a string to unicode, without using the dicom 
117
129
	//  charsets
118
130
	///////////////////////////////////////////////////////////
119
	virtual std::wstring convertToUnicode(std::string value);
131
	virtual std::wstring convertToUnicode(const std::string& value) const;
120
132
121
133
	// Convert a string from unicode, without using the dicom 
122
134
	//  charsets
123
135
	///////////////////////////////////////////////////////////
124
	virtual std::string convertFromUnicode(std::wstring value);
136
	virtual std::string convertFromUnicode(const std::wstring& value, charsetsList::tCharsetsList* pCharsetsList) const;
125
137
126
138
	// Return the maximum string's length
127
139
	///////////////////////////////////////////////////////////
128
	virtual imbxUint32 maxSize();
140
	virtual imbxUint32 maxSize() const;
129
141
130
142
	// Return the separator
131
143
	///////////////////////////////////////////////////////////
132
	virtual wchar_t getSeparator();
144
	virtual wchar_t getSeparator() const;
133
145
134
146
	imbxUint32 m_elementNumber;
135
147

Up to file-list project_files/imebra/include/dataHandlerStringAE.h:

@@ -40,14 +40,14 @@ namespace handlers
40
40
class dataHandlerStringAE : public dataHandlerString
41
41
{
42
42
public:
43
	virtual imbxUint8 getPaddingByte();
43
	virtual imbxUint8 getPaddingByte() const;
44
44
45
	virtual imbxUint32 getUnitSize();
45
	virtual imbxUint32 getUnitSize() const;
46
46
47
47
protected:
48
48
	// Return the maximum string's length
49
49
	///////////////////////////////////////////////////////////
50
	virtual imbxUint32 maxSize();
50
	virtual imbxUint32 maxSize() const;
51
51
};
52
52
53
53
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringAS.h:

@@ -67,7 +67,7 @@ public:
67
67
	/// @param unit  the units used for the parameter age
68
68
	///
69
69
	///////////////////////////////////////////////////////////
70
	virtual void setAge(imbxUint32 age, tAgeUnit unit);
70
	virtual void setAge(const imbxUint32 age, const tAgeUnit unit);
71
71
72
72
	/// \brief Retrieve the age value and its unit from the
73
73
	///         buffer handled by this handler.
@@ -80,7 +80,7 @@ public:
80
80
	///               pUnit
81
81
	///
82
82
	///////////////////////////////////////////////////////////
83
	virtual imbxUint32 getAge(tAgeUnit* pUnit);
83
	virtual imbxUint32 getAge(tAgeUnit* pUnit) const;
84
84
85
85
	/// \brief Retrieve the age from the handled buffer.
86
86
	///
@@ -90,7 +90,7 @@ public:
90
90
	///          years
91
91
	///
92
92
	///////////////////////////////////////////////////////////
93
	virtual imbxInt32 getSignedLong();
93
	virtual imbxInt32 getSignedLong() const;
94
94
95
95
	/// \brief Retrieve the age from the handled buffer.
96
96
	///
@@ -100,7 +100,7 @@ public:
100
100
	///          years
101
101
	///
102
102
	///////////////////////////////////////////////////////////
103
	virtual imbxUint32 getUnsignedLong();
103
	virtual imbxUint32 getUnsignedLong() const;
104
104
105
105
	/// \brief Retrieve the age from the handled buffer.
106
106
	///
@@ -113,21 +113,21 @@ public:
113
113
	///          years
114
114
	///
115
115
	///////////////////////////////////////////////////////////
116
	virtual double getDouble();
116
	virtual double getDouble() const;
117
117
118
118
	/// \brief Write the specified age into the handled buffer.
119
119
	///
120
120
	/// @param value the age to be written, in years
121
121
	///
122
122
	///////////////////////////////////////////////////////////
123
	virtual void setSignedLong(imbxInt32 value);
123
	virtual void setSignedLong(const imbxInt32 value);
124
124
125
125
	/// \brief Write the specified age into the handled buffer.
126
126
	///
127
127
	/// @param value the age to be written, in years
128
128
	///
129
129
	///////////////////////////////////////////////////////////
130
	virtual void setUnsignedLong(imbxUint32 value);
130
	virtual void setUnsignedLong(const imbxUint32 value);
131
131
132
132
	/// \brief Write the specified age into the handled buffer.
133
133
	///
@@ -138,17 +138,17 @@ public:
138
138
	/// @param value the age to be written, in years
139
139
	///
140
140
	///////////////////////////////////////////////////////////
141
	virtual void setDouble(double value);
141
	virtual void setDouble(const double value);
142
142
143
143
144
	virtual imbxUint8 getPaddingByte();
144
	virtual imbxUint8 getPaddingByte() const;
145
145
146
	virtual imbxUint32 getUnitSize();
146
	virtual imbxUint32 getUnitSize() const;
147
147
148
148
protected:
149
149
	// Return the maximum string's length
150
150
	///////////////////////////////////////////////////////////
151
	virtual imbxUint32 maxSize();
151
	virtual imbxUint32 maxSize() const;
152
152
};
153
153
154
154
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringCS.h:

@@ -37,14 +37,14 @@ namespace handlers
37
37
class dataHandlerStringCS : public dataHandlerString
38
38
{
39
39
public:
40
	virtual imbxUint8 getPaddingByte();
40
	virtual imbxUint8 getPaddingByte() const;
41
41
42
	virtual imbxUint32 getUnitSize();
42
	virtual imbxUint32 getUnitSize() const;
43
43
44
44
protected:
45
45
	// Return the maximum string's length
46
46
	///////////////////////////////////////////////////////////
47
	virtual imbxUint32 maxSize();
47
	virtual imbxUint32 maxSize() const;
48
48
};
49
49
50
50
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringDS.h:

@@ -38,36 +38,36 @@ class dataHandlerStringDS : public dataH
38
38
public:
39
39
	// Overwritten to use getDouble()
40
40
	///////////////////////////////////////////////////////////
41
	virtual imbxInt32 getSignedLong();
41
	virtual imbxInt32 getSignedLong() const;
42
42
43
43
	// Overwritten to use getDouble()
44
44
	///////////////////////////////////////////////////////////
45
	virtual imbxUint32 getUnsignedLong();
45
	virtual imbxUint32 getUnsignedLong() const;
46
46
47
47
	// Overwritten to use setDouble()
48
48
	///////////////////////////////////////////////////////////
49
	virtual void setSignedLong(imbxInt32 value);
49
	virtual void setSignedLong(const imbxInt32 value);
50
50
51
51
	// Overwritten to use setDouble()
52
52
	///////////////////////////////////////////////////////////
53
	virtual void setUnsignedLong(imbxUint32 value);
53
	virtual void setUnsignedLong(const imbxUint32 value);
54
54
55
55
	// Overwritten to use the exponential form if needed
56
56
	///////////////////////////////////////////////////////////
57
	virtual void setDouble(double value);
57
	virtual void setDouble(const double value);
58
58
59
59
	// Get the padding byte
60
60
	///////////////////////////////////////////////////////////
61
	virtual imbxUint8 getPaddingByte();
61
	virtual imbxUint8 getPaddingByte() const;
62
62
63
63
	// Get the element size
64
64
	///////////////////////////////////////////////////////////
65
	virtual imbxUint32 getUnitSize();
65
	virtual imbxUint32 getUnitSize() const;
66
66
67
67
protected:
68
68
	// Return the maximum string's length
69
69
	///////////////////////////////////////////////////////////
70
	virtual imbxUint32 maxSize();
70
	virtual imbxUint32 maxSize() const;
71
71
72
72
};
73
73

Up to file-list project_files/imebra/include/dataHandlerStringIS.h:

@@ -38,24 +38,24 @@ class dataHandlerStringIS : public dataH
38
38
public:
39
39
	// Overwritten to use getSignedLong()
40
40
	///////////////////////////////////////////////////////////
41
	virtual double getDouble();
41
	virtual double getDouble() const;
42
42
43
43
	// Overwritten to use setSignedLong()
44
44
	///////////////////////////////////////////////////////////
45
	virtual void setDouble(double value);
45
	virtual void setDouble(const double value);
46
46
47
47
	// Get the padding byte
48
48
	///////////////////////////////////////////////////////////
49
	virtual imbxUint8 getPaddingByte();
49
	virtual imbxUint8 getPaddingByte() const;
50
50
51
51
	// Get the element size
52
52
	///////////////////////////////////////////////////////////
53
	virtual imbxUint32 getUnitSize();
53
	virtual imbxUint32 getUnitSize() const;
54
54
55
55
protected:
56
56
	// Return the maximum string's length
57
57
	///////////////////////////////////////////////////////////
58
	virtual imbxUint32 maxSize();
58
	virtual imbxUint32 maxSize() const;
59
59
};
60
60
61
61
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringLO.h:

@@ -39,14 +39,14 @@ namespace handlers
39
39
class dataHandlerStringLO : public dataHandlerStringUnicode
40
40
{
41
41
public:
42
	virtual imbxUint8 getPaddingByte();
42
	virtual imbxUint8 getPaddingByte() const;
43
43
44
	virtual imbxUint32 getUnitSize();
44
	virtual imbxUint32 getUnitSize() const;
45
45
46
46
protected:
47
47
	// Return the maximum string's length
48
48
	///////////////////////////////////////////////////////////
49
	virtual imbxUint32 maxSize();
49
	virtual imbxUint32 maxSize() const;
50
50
};
51
51
52
52
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringLT.h:

@@ -39,18 +39,18 @@ namespace handlers
39
39
class dataHandlerStringLT : public dataHandlerStringUnicode
40
40
{
41
41
public:
42
	virtual imbxUint8 getPaddingByte();
42
	virtual imbxUint8 getPaddingByte() const;
43
43
44
	virtual imbxUint32 getUnitSize();
44
	virtual imbxUint32 getUnitSize() const;
45
45
46
46
protected:
47
47
	// Return the maximum string's length
48
48
	///////////////////////////////////////////////////////////
49
	virtual imbxUint32 maxSize();
49
	virtual imbxUint32 maxSize() const;
50
50
51
	// TRUE if \ is used as a separator
51
	// Separator
52
52
	///////////////////////////////////////////////////////////
53
	virtual wchar_t getSeparator();
53
	virtual wchar_t getSeparator() const;
54
54
};
55
55
56
56
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringPN.h:

@@ -69,18 +69,18 @@ myDataSet->setUnicodeString(L"<-"); // :
69
69
class dataHandlerStringPN : public dataHandlerStringUnicode
70
70
{
71
71
public:
72
	virtual imbxUint8 getPaddingByte();
72
	virtual imbxUint8 getPaddingByte() const;
73
73
74
	virtual imbxUint32 getUnitSize();
74
	virtual imbxUint32 getUnitSize() const;
75
75
76
76
protected:
77
77
	// Return the maximum string's length
78
78
	///////////////////////////////////////////////////////////
79
	virtual imbxUint32 maxSize();
79
	virtual imbxUint32 maxSize() const;
80
80
81
81
	// Returns the separator =
82
82
	///////////////////////////////////////////////////////////
83
	virtual wchar_t getSeparator();
83
	virtual wchar_t getSeparator() const;
84
84
};
85
85
86
86
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringSH.h:

@@ -39,14 +39,14 @@ namespace handlers
39
39
class dataHandlerStringSH : public dataHandlerStringUnicode
40
40
{
41
41
public:
42
	virtual imbxUint8 getPaddingByte();
42
	virtual imbxUint8 getPaddingByte() const;
43
43
44
	virtual imbxUint32 getUnitSize();
44
	virtual imbxUint32 getUnitSize() const;
45
45
46
46
protected:
47
47
	// Return the maximum string's length
48
48
	///////////////////////////////////////////////////////////
49
	virtual imbxUint32 maxSize();
49
	virtual imbxUint32 maxSize() const;
50
50
51
51
};
52
52

Up to file-list project_files/imebra/include/dataHandlerStringST.h:

@@ -39,18 +39,18 @@ namespace handlers
39
39
class dataHandlerStringST : public dataHandlerStringUnicode
40
40
{
41
41
public:
42
	virtual imbxUint8 getPaddingByte();
42
	virtual imbxUint8 getPaddingByte() const;
43
43
44
	virtual imbxUint32 getUnitSize();
44
	virtual imbxUint32 getUnitSize() const;
45
45
46
46
protected:
47
47
	// Return the maximum string's length
48
48
	///////////////////////////////////////////////////////////
49
	virtual imbxUint32 maxSize();
49
	virtual imbxUint32 maxSize() const;
50
50
51
51
	// Returns the separator
52
52
	///////////////////////////////////////////////////////////
53
	virtual wchar_t getSeparator();
53
	virtual wchar_t getSeparator() const;
54
54
};
55
55
56
56
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringUI.h:

@@ -39,18 +39,18 @@ namespace handlers
39
39
class dataHandlerStringUI : public dataHandlerString
40
40
{
41
41
public:
42
	virtual imbxUint8 getPaddingByte();
42
	virtual imbxUint8 getPaddingByte() const;
43
43
44
	virtual imbxUint32 getUnitSize();
44
	virtual imbxUint32 getUnitSize() const;
45
45
46
46
protected:
47
47
	// Return the maximum string's length
48
48
	///////////////////////////////////////////////////////////
49
	virtual imbxUint32 maxSize();
49
	virtual imbxUint32 maxSize() const;
50
50
51
51
	// Returns the separator
52
52
	///////////////////////////////////////////////////////////
53
	virtual wchar_t getSeparator();
53
	virtual wchar_t getSeparator() const;
54
54
};
55
55
56
56
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringUT.h:

@@ -39,18 +39,18 @@ namespace handlers
39
39
class dataHandlerStringUT : public dataHandlerStringUnicode
40
40
{
41
41
public:
42
	virtual imbxUint8 getPaddingByte();
42
	virtual imbxUint8 getPaddingByte() const;
43
43
44
	virtual imbxUint32 getUnitSize();
44
	virtual imbxUint32 getUnitSize() const;
45
45
46
46
protected:
47
47
	// Return the maximum string's length
48
48
	///////////////////////////////////////////////////////////
49
	virtual imbxUint32 maxSize();
49
	virtual imbxUint32 maxSize() const;
50
50
51
51
	// TRUE if \ is used as a separator
52
52
	///////////////////////////////////////////////////////////
53
	virtual wchar_t getSeparator();
53
	virtual wchar_t getSeparator() const;
54
54
};
55
55
56
56
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerStringUnicode.h:

@@ -68,33 +68,33 @@ public:
68
68
	///                      dicom charsets used in the string
69
69
	///
70
70
	///////////////////////////////////////////////////////////
71
	virtual void getCharsetsList(charsetsList::tCharsetsList* pCharsetsList);
71
	virtual void getCharsetsList(charsetsList::tCharsetsList* pCharsetsList) const;
72
72
73
73
protected:
74
74
	// Convert a string to unicode, using the dicom charsets
75
75
	///////////////////////////////////////////////////////////
76
	virtual std::wstring convertToUnicode(std::string value);
76
	virtual std::wstring convertToUnicode(const std::string& value) const;
77
77
78
78
	// Convert a string from unicode, using the dicom charsets
79
79
	///////////////////////////////////////////////////////////
80
	virtual std::string convertFromUnicode(std::wstring value);
80
	virtual std::string convertFromUnicode(const std::wstring& value, charsetsList::tCharsetsList* pCharsetsList) const;
81
81
82
82
	charsetConversion m_charsetConversion;
83
83
	charsetConversion m_localeCharsetConversion;
84
84
85
	dicomCharsetInformation* getCharsetInfo(std::wstring dicomName);
85
	dicomCharsetInformation* getCharsetInfo(const std::wstring& dicomName) const;
86
86
};
87
87
88
88
class dataHandlerStringUnicodeException: public std::runtime_error
89
89
{
90
90
public:
91
	dataHandlerStringUnicodeException(std::string message): std::runtime_error(message){}
91
	dataHandlerStringUnicodeException(const std::string& message): std::runtime_error(message){}
92
92
};
93
93
94
94
class dataHandlerStringUnicodeExceptionUnknownCharset: public dataHandlerStringUnicodeException
95
95
{
96
96
public:
97
	dataHandlerStringUnicodeExceptionUnknownCharset(std::string message): dataHandlerStringUnicodeException(message){}
97
	dataHandlerStringUnicodeExceptionUnknownCharset(const std::string& message): dataHandlerStringUnicodeException(message){}
98
98
};
99
99
100
100
} // namespace handlers

Up to file-list project_files/imebra/include/dataHandlerTime.h:

@@ -39,7 +39,7 @@ class dataHandlerTime : public dataHandl
39
39
{
40
40
41
41
public:
42
	virtual imbxUint32 getUnitSize();
42
	virtual imbxUint32 getUnitSize() const;
43
43
44
44
	virtual void getDate(
45
45
		imbxInt32* pYear, 
@@ -50,7 +50,7 @@ public:
50
50
		imbxInt32* pSeconds,
51
51
		imbxInt32* pNanoseconds,
52
52
		imbxInt32* pOffsetHours,
53
		imbxInt32* pOffsetMinutes);
53
		imbxInt32* pOffsetMinutes) const;
54
54
55
55
	virtual void setDate(
56
56
		imbxInt32 year, 
@@ -77,7 +77,7 @@ public:
77
77
	///          buffer
78
78
	///
79
79
	///////////////////////////////////////////////////////////
80
	virtual std::wstring getUnicodeString();
80
	virtual std::wstring getUnicodeString() const;
81
81
82
82
	/// \brief Set the date from a string.
83
83
	///
@@ -91,12 +91,12 @@ public:
91
91
	/// @param value the string representing the time to be set
92
92
	///
93
93
	///////////////////////////////////////////////////////////
94
	virtual void setUnicodeString(std::wstring value);
94
	virtual void setUnicodeString(const std::wstring& value);
95
95
96
	void parseBuffer(ptr<memory> memoryBuffer);
96
	void parseBuffer(const ptr<memory>& memoryBuffer);
97
97
98
98
protected:
99
	virtual imbxUint32 maxSize();
99
	virtual imbxUint32 maxSize() const;
100
100
};
101
101
102
102
} // namespace handlers

Up to file-list project_files/imebra/include/image.h:

@@ -36,7 +36,7 @@ namespace handlers
36
36
	///  subsampled.
37
37
	///
38
38
	/// The application never needs to resize the data managed
39
	///  by this handler because the object image does this.
39
	///  by this handler because the image object does this.
40
40
	///
41
41
	///////////////////////////////////////////////////////////
42
42
	typedef dataHandlerNumeric<imbxInt32> imageHandler;
@@ -87,12 +87,12 @@ public:
87
87
	image():
88
88
		baseObject(ptr<baseObject>(new baseObject) ),
89
89
			m_rowLength(0),
90
			m_channelPixelSize(0),
91
			m_channelsNumber(0),
92
			m_imageDepth(depthUnknown),
93
			m_highBit(0),
94
			m_sizeX(0),
95
			m_sizeY(0),
90
			m_channelPixelSize(0),
91
			m_channelsNumber(0),
92
			m_imageDepth(depthUnknown),
93
			m_highBit(0),
94
			m_sizeX(0),
95
			m_sizeY(0),
96
96
			m_sizeMmX(0),
97
97
			m_sizeMmY(0){}
98
98

Up to file-list project_files/imebra/src/buffer.cpp:

@@ -62,7 +62,7 @@ namespace imebra
62
62
//
63
63
///////////////////////////////////////////////////////////
64
64
///////////////////////////////////////////////////////////
65
buffer::buffer(ptr<baseObject> externalLock, std::string defaultType /* ="" */):
65
buffer::buffer(const ptr<baseObject>& externalLock, const std::string& defaultType /* ="" */):
66
66
	baseObject(externalLock),
67
67
		m_originalBufferPosition(0),
68
68
		m_originalBufferLength(0),
@@ -94,9 +94,9 @@ buffer::buffer(ptr<baseObject> externalL
94
94
//
95
95
///////////////////////////////////////////////////////////
96
96
///////////////////////////////////////////////////////////
97
buffer::buffer(ptr<baseObject> externalLock,
98
		std::string defaultType,
99
		ptr<baseStream> originalStream,
97
buffer::buffer(const ptr<baseObject>& externalLock,
98
		const std::string& defaultType,
99
		const ptr<baseStream>& originalStream,
100
100
		imbxUint32 bufferPosition,
101
101
		imbxUint32 bufferLength,
102
102
		imbxUint32 wordLength,

Up to file-list project_files/imebra/src/charsetsList.cpp:

@@ -45,7 +45,7 @@ namespace charsetsList
45
45
//
46
46
///////////////////////////////////////////////////////////
47
47
///////////////////////////////////////////////////////////
48
void updateCharsets(tCharsetsList* pCharsetsList, tCharsetsList* pDestinationCharsetsList)
48
void updateCharsets(const tCharsetsList* pCharsetsList, tCharsetsList* pDestinationCharsetsList)
49
49
{
50
50
	PUNTOEXE_FUNCTION_START(L"charsetsList::updateCharsets");
51
51
@@ -59,7 +59,7 @@ void updateCharsets(tCharsetsList* pChar
59
59
	// Copy the charsets in the local list (if they are not
60
60
	//  already there)
61
61
	///////////////////////////////////////////////////////////
62
	for(tCharsetsList::iterator scanCharsets = pCharsetsList->begin(); scanCharsets != pCharsetsList->end(); ++scanCharsets)
62
	for(tCharsetsList::const_iterator scanCharsets = pCharsetsList->begin(); scanCharsets != pCharsetsList->end(); ++scanCharsets)
63
63
	{
64
64
		bool bExist = false;
65
65
		for(tCharsetsList::iterator scanExistingCharsets = pDestinationCharsetsList->begin(); scanExistingCharsets != pDestinationCharsetsList->end(); ++scanExistingCharsets)
@@ -91,11 +91,11 @@ void updateCharsets(tCharsetsList* pChar
91
91
//
92
92
///////////////////////////////////////////////////////////
93
93
///////////////////////////////////////////////////////////
94
void copyCharsets(tCharsetsList* pSourceCharsetsList, tCharsetsList* pDestinationCharsetsList)
94
void copyCharsets(const tCharsetsList* pSourceCharsetsList, tCharsetsList* pDestinationCharsetsList)
95
95
{
96
96
	PUNTOEXE_FUNCTION_START(L"charsetsList::copyCharsets");
97
97
98
	for(tCharsetsList::iterator scanCharsets = pSourceCharsetsList->begin(); scanCharsets != pSourceCharsetsList->end(); ++scanCharsets)
98
	for(tCharsetsList::const_iterator scanCharsets = pSourceCharsetsList->begin(); scanCharsets != pSourceCharsetsList->end(); ++scanCharsets)
99
99
	{
100
100
		pDestinationCharsetsList->push_back(*scanCharsets);
101
101
	}
@@ -107,4 +107,4 @@ void copyCharsets(tCharsetsList* pSource
107
107
108
108
} // namespace imebra
109
109
110
} // namespace puntoexe
110
} // namespace puntoexe

Up to file-list project_files/imebra/src/dataHandler.cpp:

@@ -112,11 +112,11 @@ void dataHandler::abort()
112
112
//
113
113
///////////////////////////////////////////////////////////
114
114
///////////////////////////////////////////////////////////
115
void dataHandler::skip(int skip)
115
void dataHandler::skip(const int skip)
116
116
{
117
117
	PUNTOEXE_FUNCTION_START(L"dataHandler::skip");
118
118
119
	while(skip--)
119
	for( int skipCount(skip); skipCount != 0; --skipCount)
120
120
	{