A class static member function cannot access a non-static member. If you want a static member function to access members of a class instance you will need to pass a pointer to the class instance as part of the static function parameters.

Why do you want IsDirectory to be static?