view dmd/StringEntry.d @ 174:af724d3510d7

lot os toCBuffer methods implemented moved shared Type.* stuff into Global
author korDen
date Sun, 10 Oct 2010 03:47:23 +0400
parents e28b18c23469
children e3afd1303184
line wrap: on
line source

module dmd.StringEntry;

import dmd.common;
import dmd.StringValue;
import dmd.Dchar;
import dmd.Lstring;

import core.stdc.stdlib;

struct StringEntry
{
    StringEntry* left;
    StringEntry* right;
    hash_t hash;

    StringValue value;
	
	this(StringEntry* other)
	{
		hash = other.hash;
		value = other.value;
	}

	this(immutable(dchar_t)[] s)
	{
		hash = Dchar.calcHash(s.ptr, s.length);
		value.lstring.string_ = s;
	}
}