Source/NFX/Serialization/Arow/CodeGenerator.cs
/// <summary>
/// Converts backend name of up to 8 ASCII chars in length
/// </summary>
Converts backend name of up to 8 ASCII chars in length
Converts backend name of up to 8 ASCII chars in length
public static ulong GetName(string name)
    {
      ulong result = 0;
      if (name.IsNullOrWhiteSpace()) return 0;
      var sl = name.Length;
      if (sl>sizeof(ulong)) throw new ArowException(StringConsts.AROW_INVALID_FIELD_NAME_ERROR.Args(name, sizeof(ulong)));
      for(var i=0; i<sizeof(ulong) && i<name.Length; i++)
      {
        result <<= 8;
        var c = name[i];
        if (c>0xff) throw new ArowException(StringConsts.AROW_INVALID_FIELD_NAME_ERROR.Args(name, sizeof(ulong)));
        result |= (byte)c;
      }
      return result;
    }
public static ulong GetName ( string name ) { ulong result = 0 ; if ( name . IsNullOrWhiteSpace ( ) ) return 0 ; var sl = name . Length ; if ( sl > sizeof ( ulong ) ) throw new ArowException ( StringConsts . AROW_INVALID_FIELD_NAME_ERROR . Args ( name , sizeof ( ulong ) ) ) ; for ( var i = 0 ; i < sizeof ( ulong ) && i < name . Length ; i ++ ) { result <<= 8 ; var c = name [ i ] ; if ( c > 0xff ) throw new ArowException ( StringConsts . AROW_INVALID_FIELD_NAME_ERROR . Args ( name , sizeof ( ulong ) ) ) ; result |= ( byte ) c ; } return result ; }
Converts backend name of up to 8 ASCII chars in length
Converts backend name of up to 8 ASCII chars in length
name
string