aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/lex/rust-codepoint.h
blob: 0f2e5bd9e1572e8fb23ce048695f8362893d5127 (plain)
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
#ifndef RUST_CODEPOINT_H
#define RUST_CODEPOINT_H

#include "config.h"
#include "system.h"
#include "coretypes.h"
// config, system, coretypes - TODO: ensure all are needed

#include <string>

namespace Rust {
struct Codepoint
{
  uint32_t value;

  // Creates a zero codepoint.
  Codepoint () : value (0) {}

  // Creates a codepoint from UTF-8 value.
  Codepoint (uint32_t value_) : value (value_) {}

  // Returns a C++ string containing value of codepoint.
  ::std::string as_string ();
};
} // namespace Rust

#endif