Skip to content

Commit 81af9d9

Browse files
committed
Fix line endings of source files
CRLF and LF were mixed in lots of files, confusing tools like `patch`.
1 parent d826fd0 commit 81af9d9

329 files changed

Lines changed: 194406 additions & 194406 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 103 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,104 @@
1-
/*
2-
Copyright (c) 2008-2009 NetAllied Systems GmbH
3-
4-
This file is part of COLLADABaseUtils.
5-
6-
Licensed under the MIT Open Source License,
7-
for details please see LICENSE file or the website
8-
http://www.opensource.org/licenses/mit-license.php
9-
*/
10-
11-
#ifndef __COLLADABU_EXCEPTION_H__
12-
#define __COLLADABU_EXCEPTION_H__
13-
14-
#include "COLLADABUPrerequisites.h"
1+
/*
2+
Copyright (c) 2008-2009 NetAllied Systems GmbH
3+
4+
This file is part of COLLADABaseUtils.
5+
6+
Licensed under the MIT Open Source License,
7+
for details please see LICENSE file or the website
8+
http://www.opensource.org/licenses/mit-license.php
9+
*/
10+
11+
#ifndef __COLLADABU_EXCEPTION_H__
12+
#define __COLLADABU_EXCEPTION_H__
13+
14+
#include "COLLADABUPrerequisites.h"
1515
#include "COLLADABUStableHeaders.h"
16-
17-
#include <iostream>
18-
19-
20-
namespace COLLADABU
21-
{
22-
23-
/** Class that is thrown by the base utils classes if something goes wrong. */
24-
class Exception
25-
{
26-
27-
public:
28-
29-
enum Type
30-
{
31-
ERROR_TYPE_UNKNOWN,
32-
ERROR_FILE_OPEN,
33-
ERROR_SET_BUFFER,
34-
ERROR_UTF8_2_WIDE,
35-
ERROR_WIDE_2_UTF8,
36-
ERROR_NATIVE_2_WIDE,
37-
ERROR_WIDE_2_NATIVE
38-
};
39-
40-
protected:
41-
42-
/** The type of the exception. */
43-
Type mExceptionType;
44-
45-
/** The error message for output. */
46-
String mMessage;
47-
48-
public:
49-
50-
/** Constructor. Creates an exception of unknown type with the given message. */
51-
Exception ( const String& message )
52-
: mExceptionType ( ERROR_TYPE_UNKNOWN )
53-
, mMessage ( message )
54-
{}
55-
56-
/** Constructor. Creates an exception of type @a type with the given message. */
57-
Exception ( Type exceptionType, const String& message )
58-
: mExceptionType ( exceptionType )
59-
, mMessage ( message )
60-
{}
61-
62-
/** Constructor. */
63-
Exception ( Type exceptionType, const String file, const long line, const String message )
64-
: mExceptionType ( exceptionType )
65-
{
66-
std::ostringstream stream;
67-
stream << file << ":" << line << ": " << message;
68-
mMessage = stream.str ().c_str ();
69-
}
70-
71-
/** Constructor. */
72-
Exception ( const String file, const long line, const String message )
73-
: mExceptionType ( ERROR_TYPE_UNKNOWN )
74-
{
75-
std::ostringstream stream;
76-
stream << file << ":" << line << ": " << message;
77-
mMessage = stream.str ().c_str ();
78-
}
79-
80-
/** Destructor. */
81-
virtual ~Exception () {}
82-
83-
/** Returns the type of the exception*/
84-
Type getType()const {return mExceptionType;}
85-
86-
/** Returns the text, describing the exception.*/
87-
String getMessage()const {return mMessage;};
88-
89-
/** Print the massage in the standard error output. */
90-
void printMessage ()
91-
{
92-
if ( mExceptionType == ERROR_TYPE_UNKNOWN )
93-
std::cerr << "MainException: " << mMessage << std::endl;
94-
else
95-
std::cerr << "MainException: " << mMessage << ", Error type " << mExceptionType << std::endl;
96-
}
97-
98-
99-
};
100-
101-
} //namespace COLLADABU
102-
103-
104-
#endif //__COLLADABU_EXCEPTION_H__
16+
17+
#include <iostream>
18+
19+
20+
namespace COLLADABU
21+
{
22+
23+
/** Class that is thrown by the base utils classes if something goes wrong. */
24+
class Exception
25+
{
26+
27+
public:
28+
29+
enum Type
30+
{
31+
ERROR_TYPE_UNKNOWN,
32+
ERROR_FILE_OPEN,
33+
ERROR_SET_BUFFER,
34+
ERROR_UTF8_2_WIDE,
35+
ERROR_WIDE_2_UTF8,
36+
ERROR_NATIVE_2_WIDE,
37+
ERROR_WIDE_2_NATIVE
38+
};
39+
40+
protected:
41+
42+
/** The type of the exception. */
43+
Type mExceptionType;
44+
45+
/** The error message for output. */
46+
String mMessage;
47+
48+
public:
49+
50+
/** Constructor. Creates an exception of unknown type with the given message. */
51+
Exception ( const String& message )
52+
: mExceptionType ( ERROR_TYPE_UNKNOWN )
53+
, mMessage ( message )
54+
{}
55+
56+
/** Constructor. Creates an exception of type @a type with the given message. */
57+
Exception ( Type exceptionType, const String& message )
58+
: mExceptionType ( exceptionType )
59+
, mMessage ( message )
60+
{}
61+
62+
/** Constructor. */
63+
Exception ( Type exceptionType, const String file, const long line, const String message )
64+
: mExceptionType ( exceptionType )
65+
{
66+
std::ostringstream stream;
67+
stream << file << ":" << line << ": " << message;
68+
mMessage = stream.str ().c_str ();
69+
}
70+
71+
/** Constructor. */
72+
Exception ( const String file, const long line, const String message )
73+
: mExceptionType ( ERROR_TYPE_UNKNOWN )
74+
{
75+
std::ostringstream stream;
76+
stream << file << ":" << line << ": " << message;
77+
mMessage = stream.str ().c_str ();
78+
}
79+
80+
/** Destructor. */
81+
virtual ~Exception () {}
82+
83+
/** Returns the type of the exception*/
84+
Type getType()const {return mExceptionType;}
85+
86+
/** Returns the text, describing the exception.*/
87+
String getMessage()const {return mMessage;};
88+
89+
/** Print the massage in the standard error output. */
90+
void printMessage ()
91+
{
92+
if ( mExceptionType == ERROR_TYPE_UNKNOWN )
93+
std::cerr << "MainException: " << mMessage << std::endl;
94+
else
95+
std::cerr << "MainException: " << mMessage << ", Error type " << mExceptionType << std::endl;
96+
}
97+
98+
99+
};
100+
101+
} //namespace COLLADABU
102+
103+
104+
#endif //__COLLADABU_EXCEPTION_H__

COLLADABaseUtils/include/COLLADABUNativeString.h

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
/*
2-
Copyright (c) 2008-2009 NetAllied Systems GmbH
3-
4-
This file is part of COLLADABaseUtils.
5-
6-
Licensed under the MIT Open Source License,
7-
for details please see LICENSE file or the website
8-
http://www.opensource.org/licenses/mit-license.php
1+
/*
2+
Copyright (c) 2008-2009 NetAllied Systems GmbH
3+
4+
This file is part of COLLADABaseUtils.
5+
6+
Licensed under the MIT Open Source License,
7+
for details please see LICENSE file or the website
8+
http://www.opensource.org/licenses/mit-license.php
99
*/
1010

1111
#ifndef __COLLADABU_NATIVESTRING_H__
@@ -18,68 +18,68 @@ namespace COLLADABU
1818
{
1919

2020
/** A string class to store strings encoded in the systems native encoding.*/
21-
22-
class NativeString : public String
23-
{
24-
public:
25-
enum Encoding
26-
{
27-
ENCODING_NATIVE,
28-
ENCODING_UTF8
29-
};
30-
public:
31-
/**Content is initialized to a copy of the string object str.
32-
If @a encoding is ENCODING_NATIVE, @a str is assumed to be encoded in the platform native encoding.
33-
If @a encoding is ENCODING_UTF8, @a str is assumed to be encoded in UTF8.*/
34-
explicit NativeString(const String& str, Encoding encoding = ENCODING_NATIVE);
35-
36-
NativeString(const WideString& wstr) : String()
37-
{
38-
fromWideString(wstr);
39-
}
40-
41-
42-
/** Content is initialized to an empty NativeString. */
43-
explicit NativeString ( );
44-
45-
/** Content is initialized to a copy of a substring of str. The substring is the portion of
46-
str that begins at the character position pos and takes up to n characters (it takes less than
47-
n if the end of str is reached before).*/
48-
// NativeString ( const String& str, size_t pos, size_t n = npos ) : String(str, pos, n){}
49-
50-
/* Content is initialized to a copy of the string formed by the first n characters in the array
51-
of characters pointed by s.*/
52-
// NativeString ( const char * s, size_t n ) : String(s, n){}
53-
54-
/** Content is initialized to a copy of the string formed by the null-terminated character sequence
55-
(C string) pointed by s. The length of the character sequence is determined by the first occurrence
56-
of a null character (as determined by traits.length(s)). This version can be used to initialize a
57-
string object using a string literal constant.*/
58-
explicit NativeString ( const char * s, Encoding encoding = ENCODING_NATIVE);
59-
60-
/** Content is initialized as a string formed by a repetition of character c, n times.*/
61-
// NativeString ( size_t n, char c ) : String(n, c){}
62-
63-
/**If InputIterator is an integral type, behaves as the sixth constructor version (the one right above
64-
this) by typecasting begin and end to call it:
65-
string(static_cast<size_t>(begin),static_cast<char>(end));
66-
In any other case, the parameters are taken as iterators, and the content is initialized with the values
67-
of the elements that go from the element referred by iterator begin to the element right before the one
68-
referred by iterator end.
69-
*/
70-
template<class InputIterator>
71-
NativeString (InputIterator begin, InputIterator end) : String(begin, end) {}
72-
73-
/** Returns the string as unicode encoded wide string.*/
74-
WideString toWideString()const;
75-
76-
/** Returns the string as utf encoded string.*/
77-
String toUtf8String() const;
78-
79-
80-
private:
81-
void fromWideString(const WideString& wstr);
82-
};
21+
22+
class NativeString : public String
23+
{
24+
public:
25+
enum Encoding
26+
{
27+
ENCODING_NATIVE,
28+
ENCODING_UTF8
29+
};
30+
public:
31+
/**Content is initialized to a copy of the string object str.
32+
If @a encoding is ENCODING_NATIVE, @a str is assumed to be encoded in the platform native encoding.
33+
If @a encoding is ENCODING_UTF8, @a str is assumed to be encoded in UTF8.*/
34+
explicit NativeString(const String& str, Encoding encoding = ENCODING_NATIVE);
35+
36+
NativeString(const WideString& wstr) : String()
37+
{
38+
fromWideString(wstr);
39+
}
40+
41+
42+
/** Content is initialized to an empty NativeString. */
43+
explicit NativeString ( );
44+
45+
/** Content is initialized to a copy of a substring of str. The substring is the portion of
46+
str that begins at the character position pos and takes up to n characters (it takes less than
47+
n if the end of str is reached before).*/
48+
// NativeString ( const String& str, size_t pos, size_t n = npos ) : String(str, pos, n){}
49+
50+
/* Content is initialized to a copy of the string formed by the first n characters in the array
51+
of characters pointed by s.*/
52+
// NativeString ( const char * s, size_t n ) : String(s, n){}
53+
54+
/** Content is initialized to a copy of the string formed by the null-terminated character sequence
55+
(C string) pointed by s. The length of the character sequence is determined by the first occurrence
56+
of a null character (as determined by traits.length(s)). This version can be used to initialize a
57+
string object using a string literal constant.*/
58+
explicit NativeString ( const char * s, Encoding encoding = ENCODING_NATIVE);
59+
60+
/** Content is initialized as a string formed by a repetition of character c, n times.*/
61+
// NativeString ( size_t n, char c ) : String(n, c){}
62+
63+
/**If InputIterator is an integral type, behaves as the sixth constructor version (the one right above
64+
this) by typecasting begin and end to call it:
65+
string(static_cast<size_t>(begin),static_cast<char>(end));
66+
In any other case, the parameters are taken as iterators, and the content is initialized with the values
67+
of the elements that go from the element referred by iterator begin to the element right before the one
68+
referred by iterator end.
69+
*/
70+
template<class InputIterator>
71+
NativeString (InputIterator begin, InputIterator end) : String(begin, end) {}
72+
73+
/** Returns the string as unicode encoded wide string.*/
74+
WideString toWideString()const;
75+
76+
/** Returns the string as utf encoded string.*/
77+
String toUtf8String() const;
78+
79+
80+
private:
81+
void fromWideString(const WideString& wstr);
82+
};
8383

8484
}
8585

0 commit comments

Comments
 (0)