private MySqlTypeBase GetMySqlTypeString(DbTypeString type) { string attr = type.GetSpecificAttribute("mysql", "subtype"); MySqlTypeEnumSet reses = null; if (attr == "enum") { reses = new MySqlTypeEnum(); } if (attr == "set") { reses = new MySqlTypeSet(); } if (reses != null) { string vals = type.GetSpecificAttribute("mysql", "values"); if (vals != null) { reses.Values.AddRange(vals.Split(',')); return(reses); } else { return(new MySqlTypeVarChar()); } } MySqlTypeCharacter res; if (type.IsVarLength) { if (type.IsBinary) { res = new MySqlTypeVarBinary(); } else { res = new MySqlTypeVarChar(); } } else { if (type.IsBinary) { res = new MySqlTypeBinary(); } else { res = new MySqlTypeChar(); } } res.Length = type.Length; return(res); }
private MySqlTypeBase ReadNumSet(MySqlTypeEnumSet res) { SkipSymbol("("); bool was = false; while (!IsSymbol(")")) { if (was) { SkipSymbol(","); } res.Values.Add(SkipToken()); was = true; } SkipSymbol(")"); return(res); }