private static SolarisPatchInfo parsePatchInfo(string myLine) { SolarisPatchInfo retVal = new SolarisPatchInfo(); bool gotToPatch = false; string patchName = ""; foreach (char c in myLine) { bool isPatchChar = (((c >= '0') && (c <= '9')) || (c == '-')); if (gotToPatch && !isPatchChar) break; if (isPatchChar) { gotToPatch = true; patchName += c; } } string[] comps = patchName.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries); retVal.Base = ulong.Parse(comps[0]); if (comps.Length > 1) retVal.Version = ulong.Parse(comps[1]); else retVal.Version = 0; return retVal; }
private static SolarisPatchInfo parsePatchInfo(string myLine) { SolarisPatchInfo retVal = new SolarisPatchInfo(); bool gotToPatch = false; string patchName = ""; foreach (char c in myLine) { bool isPatchChar = (((c >= '0') && (c <= '9')) || (c == '-')); if (gotToPatch && !isPatchChar) { break; } if (isPatchChar) { gotToPatch = true; patchName += c; } } string[] comps = patchName.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries); retVal.Base = ulong.Parse(comps[0]); if (comps.Length > 1) { retVal.Version = ulong.Parse(comps[1]); } else { retVal.Version = 0; } return(retVal); }