Skip to content

Commit 4ed7fee

Browse files
committed
Add Windows 3.1 Latin 5 text encoding and aliases recognision.
1 parent b6d581f commit 4ed7fee

4 files changed

Lines changed: 77 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include <type_traits>
2+
3+
#include "../textencodingtype.h"
4+
5+
#ifndef CRAP_TEXTENCODING_IANAENCODINGS_WINDOWS31LATIN5TEXTENCODINGTYPE
6+
#define CRAP_TEXTENCODING_IANAENCODINGS_WINDOWS31LATIN5TEXTENCODINGTYPE
7+
8+
namespace crap
9+
{
10+
using text_encoding_id_Windows31Latin5_t =
11+
std :: integral_constant<textEncodingType <void> :: id, textEncodingType <void> :: id :: Windows31Latin5>;
12+
13+
template <>
14+
struct textEncodingType<text_encoding_id_Windows31Latin5_t> : textEncodingType<void>
15+
{
16+
using mib = text_encoding_id_Windows31Latin5_t;
17+
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '9', '-', 'W', 'i', 'n', 'd', 'o', 'w', 's', '-', 'L', 'a', 't', 'i', 'n', '-', '5'>;
18+
using aliases = typeList<
19+
string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '9', '-', 'W', 'i', 'n', 'd', 'o', 'w', 's', '-', 'L', 'a', 't', 'i', 'n', '-', '5'>,
20+
string<char, 'c', 's', 'W', 'i', 'n', 'd', 'o', 'w', 's', '3', '1', 'L', 'a', 't', 'i', 'n', '5'> >;
21+
};
22+
23+
template <>
24+
struct textEncodingType<string<char, 'c', 's', 'W', 'i', 'n', 'd', 'o', 'w', 's', '3', '1', 'L', 'a', 't', 'i', 'n', '5'> >
25+
: textEncodingType<text_encoding_id_Windows31Latin5_t>
26+
{
27+
};
28+
29+
template <>
30+
struct textEncodingType<string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '9', '-', 'W', 'i', 'n', 'd', 'o', 'w', 's', '-', 'L', 'a', 't', 'i', 'n', '-', '5'> >
31+
: textEncodingType<text_encoding_id_Windows31Latin5_t>
32+
{
33+
};
34+
}
35+
#endif
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include <type_traits>
2+
3+
#include "../IANA_encodings.d/Windows31Latin5_textencodingtype.h"
4+
#include "../textencodingtype.h"
5+
6+
#ifndef CRAP_TEXTENCODING_ALIASES_WINDOWS31LATIN5TEXTENCODINGTYPEALIAS
7+
#define CRAP_TEXTENCODING_ALIASES_WINDOWS31LATIN5TEXTENCODINGTYPEALIAS
8+
9+
namespace crap
10+
{
11+
template <class CharType, CharType ... Letters>
12+
template <class PlaceHolder>
13+
struct textEncodingType<string<CharType, Letters...> > ::
14+
alias<PlaceHolder, char, 'c', 's', 'w', 'i', 'n', 'd', 'o', 'w', 's', '3', '1', 'l', 'a', 't', 'i', 'n', '5'>
15+
: textEncodingType<text_encoding_id_Windows31Latin5_t>
16+
{
17+
};
18+
19+
template <class CharType, CharType ... Letters>
20+
template <class PlaceHolder>
21+
struct textEncodingType<string<CharType, Letters...> > ::
22+
alias<PlaceHolder, char, 'i', 's', 'o', '8', '8', '5', '9', '9', 'w', 'i', 'n', 'd', 'o', 'w', 's', 'l', 'a', 't', 'i', 'n', '5'>
23+
: textEncodingType<text_encoding_id_Windows31Latin5_t>
24+
{
25+
};
26+
}
27+
#endif
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "../textencodingtype.h"
2+
3+
#ifndef CRAP_TEXTENCODING_ALIASESDECLARATIONS_WINDOWS31LATIN5TEXTENCODINGTYPEALIASESDECLARATION
4+
#define CRAP_TEXTENCODING_ALIASESDECLARATIONS_WINDOWS31LATIN5TEXTENCODINGTYPEALIASESDECLARATION
5+
6+
template <class PlaceHolder>
7+
struct alias<PlaceHolder, char, 'c', 's', 'w', 'i', 'n', 'd', 'o', 'w', 's', '3', '1', 'l', 'a', 't', 'i', 'n', '5'>;
8+
9+
template <class PlaceHolder>
10+
struct alias<PlaceHolder, char, 'i', 's', 'o', '8', '8', '5', '9', '9', 'w', 'i', 'n', 'd', 'o', 'w', 's', 'l', 'a', 't', 'i', 'n', '5'>;
11+
12+
#endif

include/crap/text_encoding.d/textencodingtype.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ namespace crap
446446
#include "IANA_encodings.d/Windows30Latin1_textencodingtype.h"
447447
#include "IANA_encodings.d/Windows31Latin1_textencodingtype.h"
448448
#include "IANA_encodings.d/Windows31Latin2_textencodingtype.h"
449+
#include "IANA_encodings.d/Windows31Latin5_textencodingtype.h"
449450

450451
namespace crap
451452
{
@@ -894,6 +895,7 @@ namespace crap
894895
#include "aliases_declarations.d/Windows30Latin1_textencodingtype_aliasesdeclaration.h"
895896
#include "aliases_declarations.d/Windows31Latin1_textencodingtype_aliasesdeclaration.h"
896897
#include "aliases_declarations.d/Windows31Latin2_textencodingtype_aliasesdeclaration.h"
898+
#include "aliases_declarations.d/Windows31Latin5_textencodingtype_aliasesdeclaration.h"
897899
//
898900
template <CharType ... SubLetters>
899901
using aliasMaker = alias<CharType, CharType, SubLetters...>;
@@ -1129,6 +1131,7 @@ namespace crap
11291131
#include "aliases.d/Windows30Latin1_textencodingtype_alias.h"
11301132
#include "aliases.d/Windows31Latin1_textencodingtype_alias.h"
11311133
#include "aliases.d/Windows31Latin2_textencodingtype_alias.h"
1134+
#include "aliases.d/Windows31Latin5_textencodingtype_alias.h"
11321135

11331136
namespace crap
11341137
{

0 commit comments

Comments
 (0)