Skip to content

Commit f8d9b7a

Browse files
Namespace changes.
1 parent 65d4fb8 commit f8d9b7a

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

TextEncodingDetect-C++/TextEncodingDetect/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2015 Jonathan Bennett <[email protected]>
2+
// Copyright 2015-2016 Jonathan Bennett <[email protected]>
33
//
44
// https://www.autoitscript.com
55
//
@@ -20,7 +20,7 @@
2020
#include <tchar.h>
2121

2222
#include "text_encoding_detect.h"
23-
using namespace AutoIt::Text;
23+
using namespace AutoIt::Common;
2424

2525

2626
int wmain(int argc, wchar_t* argv[])

TextEncodingDetect-C++/TextEncodingDetect/text_encoding_detect.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2015 Jonathan Bennett <[email protected]>
2+
// Copyright 2015-2016 Jonathan Bennett <[email protected]>
33
//
44
// https://www.autoitscript.com
55
//
@@ -19,7 +19,7 @@
1919
// Includes
2020
#include "text_encoding_detect.h"
2121

22-
using namespace AutoIt::Text;
22+
using namespace AutoIt::Common;
2323

2424
static const unsigned char TextEncodingDetect_UTF16_BOM_LE[] = { unsigned char(0xFF), unsigned char(0xFE) };
2525
static const unsigned char TextEncodingDetect_UTF16_BOM_BE[] = { unsigned char(0xFE), unsigned char(0xFF) };
@@ -123,7 +123,7 @@ TextEncodingDetect::Encoding TextEncodingDetect::CheckBOM(const unsigned char *p
123123
// "None" if it just looks like binary data.
124124
///////////////////////////////////////////////////////////////////////////////
125125

126-
TextEncodingDetect::Encoding TextEncodingDetect::DetectEncoding(const unsigned char *pBuffer, size_t size)
126+
TextEncodingDetect::Encoding TextEncodingDetect::DetectEncoding(const unsigned char *pBuffer, size_t size) const
127127
{
128128
// First check if we have a BOM and return that if so
129129
Encoding encoding = CheckBOM(pBuffer, size);
@@ -165,7 +165,7 @@ TextEncodingDetect::Encoding TextEncodingDetect::DetectEncoding(const unsigned c
165165
// ASCII - Only data in the 0-127 range.
166166
///////////////////////////////////////////////////////////////////////////////
167167

168-
TextEncodingDetect::Encoding TextEncodingDetect::CheckUTF8(const unsigned char *pBuffer, size_t size)
168+
TextEncodingDetect::Encoding TextEncodingDetect::CheckUTF8(const unsigned char *pBuffer, size_t size) const
169169
{
170170
// UTF8 Valid sequences
171171
// 0xxxxxxx ASCII
@@ -303,7 +303,7 @@ TextEncodingDetect::Encoding TextEncodingDetect::CheckUTF16NewlineChars(const un
303303
// UTF16_BE_NOBOM - looks like utf16 be
304304
///////////////////////////////////////////////////////////////////////////////
305305

306-
TextEncodingDetect::Encoding TextEncodingDetect::CheckUTF16ASCII(const unsigned char *pBuffer, size_t size)
306+
TextEncodingDetect::Encoding TextEncodingDetect::CheckUTF16ASCII(const unsigned char *pBuffer, size_t size) const
307307
{
308308
int num_odd_nulls = 0;
309309
int num_even_nulls = 0;

TextEncodingDetect-C++/TextEncodingDetect/text_encoding_detect.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
namespace AutoIt
2727
{
28-
namespace Text
28+
namespace Common
2929
{
3030
class TextEncodingDetect
3131
{
@@ -46,8 +46,8 @@ namespace Text
4646
TextEncodingDetect();
4747
~TextEncodingDetect();
4848

49-
Encoding CheckBOM(const unsigned char *pBuffer, size_t size); // Just check if there is a BOM and return
50-
Encoding DetectEncoding(const unsigned char *pBuffer, size_t size); // Check BOM and also guess if there is no BOM
49+
static Encoding CheckBOM(const unsigned char *pBuffer, size_t size); // Just check if there is a BOM and return
50+
Encoding DetectEncoding(const unsigned char *pBuffer, size_t size) const; // Check BOM and also guess if there is no BOM
5151
static int GetBOMLengthFromEncodingMode(Encoding encoding); // Just return the BOM length of a given mode
5252

5353
void SetNullSuggestsBinary(bool null_suggests_binary) { null_suggests_binary_ = null_suggests_binary; }
@@ -66,13 +66,13 @@ namespace Text
6666
int utf16_expected_null_percent_;
6767
int utf16_unexpected_null_percent_;
6868

69-
Encoding CheckUTF8(const unsigned char *pBuffer, size_t size); // Check for valid UTF8 with no BOM
70-
Encoding CheckUTF16NewlineChars(const unsigned char *pBuffer, size_t size); // Check for valid UTF16 with no BOM via control chars
71-
Encoding CheckUTF16ASCII(const unsigned char *pBuffer, size_t size); // Check for valid UTF16 with no BOM via null distribution
72-
bool DoesContainNulls(const unsigned char *pBuffer, size_t size); // Check for nulls
69+
Encoding CheckUTF8(const unsigned char *pBuffer, size_t size) const; // Check for valid UTF8 with no BOM
70+
static Encoding CheckUTF16NewlineChars(const unsigned char *pBuffer, size_t size); // Check for valid UTF16 with no BOM via control chars
71+
Encoding CheckUTF16ASCII(const unsigned char *pBuffer, size_t size) const; // Check for valid UTF16 with no BOM via null distribution
72+
static bool DoesContainNulls(const unsigned char *pBuffer, size_t size); // Check for nulls
7373
};
7474

75-
} // AutoIt.Text
75+
} // AutoIt.Common
7676
} // AutoIt
7777

7878
//////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)