public TProfFunc(TCacheGrind ACacheGrind, string AName, string AFileName) { CacheGrind = ACacheGrind; Name = AName; FileName = AFileName; ShortFileName = GetShortFileName(); ShortName = GetShortName(); Instances = new List <TProfInstance>(); // analyze Name to get Kind Kind = TFuncKind.fkFunc; if (AName.StartsWith("include::") || AName.StartsWith("include_once::") || AName.StartsWith("require::") || AName.StartsWith("require_once::")) { Kind = TFuncKind.fkInclude; } else if (AName.StartsWith("php::")) { Kind = TFuncKind.fkLibFunc; } else if (IsCons(AName)) { Kind = TFuncKind.fkConstructor; } else if (IsDest(AName)) { Kind = TFuncKind.fkDestructor; } else if (AName.Contains("->object") || AName.Contains("__construct") || AName.Contains("::pear")) { Kind = TFuncKind.fkConstructor; } else if (AName.Contains("__destruct") || AName.Contains("_object") || AName.Contains("::_pear")) { Kind = TFuncKind.fkDestructor; } else if (AName.Contains("::_") || AName.Contains("->_")) { Kind = TFuncKind.fkPrivateMethod; } else if (AName.Contains("::")) { Kind = TFuncKind.fkStaticMethod; } else if (AName.Contains("->")) { Kind = TFuncKind.fkPublicMethod; } }
private int GetImageIndex(TFuncKind Kind) { return((int)Kind); }