Simple question about TString::Contains

I have a simple code to test TString::Contains (see attached file). If I just execute it without compiling, it is fine. However, once I try to compile it, I was given an error:

/scratch/zyliu/job.code/job.Fermilab200608/./macros/testConstant.C:6: error: invalid conversion from int' toTString::ECaseCompare’
/scratch/zyliu/job.code/job.Fermilab200608/./macros/testConstant.C:6: error: initializing argument 2 of Bool_t TString::Contains(const char*, TString::ECaseCompare) const' /scratch/zyliu/job.code/job.Fermilab200608/./macros/testConstant.C:9: error: invalid conversion fromint’ to TString::ECaseCompare' /scratch/zyliu/job.code/job.Fermilab200608/./macros/testConstant.C:9: error: initializing argument 2 ofBool_t TString::Contains(const char*, TString::ECaseCompare) const’

Actually, the essence of my problem is that I don’t know how to use a function member which arguments include “enum” . Can you point me out how to do that?

testConstant.C (472 Bytes)


use e.g. mystr.Contains(“root”, TString::kIgnoreCase). The enum is a type contained in TString. Its constants are thus like data members of TString; see … ing:kExact