-
Notifications
You must be signed in to change notification settings - Fork 23
/
STCharacter.h
44 lines (31 loc) · 1.29 KB
/
STCharacter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/******************************************************************************
File: STCharacter.h
Description:
VM representation of Smalltalk Character class.
N.B. The class here defined is well known to the VM, and must not
be modified in the image. Note also that this class may also have
a representation in the assembler modules (so see istasm.inc)
******************************************************************************/
#pragma once
#include "STMagnitude.h"
#include "STString.h"
namespace ST { class Character; }
typedef TOTE<ST::Character> CharOTE;
namespace ST
{
class Character : public Magnitude
{
public:
Oop m_code; // Small integer value.
enum { CharacterValueIndex = Magnitude::FixedSize, FixedSize };
static CharOTE* NewAnsi(unsigned char value);
static CharOTE* NewUnicode(MWORD value);
__declspec(property(get = getEncoding)) StringEncoding Encoding;
StringEncoding getEncoding() const { return static_cast<StringEncoding>(m_code >> 25); }
__declspec(property(get = getCodeUnit)) MWORD CodeUnit;
MWORD getCodeUnit() const { return ObjectMemoryIntegerValueOf(m_code) & 0xffffff; }
__declspec(property(get = getCodePoint)) uint32_t CodePoint;
uint32_t getCodePoint() const;
};
}
std::wostream& operator<<(std::wostream& st, const CharOTE* oteCh);