/// <summary>
/// Creates a new AtomizedString object.
/// </summary>
/// <param name="str">The string. May not be null.</param>
/// <param name="nameTable">The <Typ>NameTable</Typ> that should contain <P>str</P>,
/// although this is not enforced (see remarks.)</param>
/// <remarks>
/// In order for <Typ>AtomizedString</Typ> comparisons to work correctly, the <P>str</P>
/// parameter must be contained in the <P>nameTable</P>. For performance reasons, this
/// is not checked at runtime, except in debug builds where it throws ArgumentException.
/// </remarks>
/// <exception cref="ArgumentNullException">
/// <P>str</P> or <P>nameTable</P> is null.
/// </exception>
/// <exception cref="ArgumentException">
/// (debug build only) <P>nameTable</P> does not contain <P>str</P>.
/// </exception>
internal AtomizedString(string str, NameTable nameTable)
{
if (str == null) throw new ArgumentNullException("str");
if (nameTable == null) throw new ArgumentNullException("nameTable");
m_NameTable = nameTable;
// although there is no real guarantee that str is in nameTable without
// specifically checking, it's not worth it to do so (except in debug builds.)
#if DEBUG
if (null == nameTable.Get(str)) throw new ArgumentException(Resources.WrongNameTable);
#endif
m_String = str;
}