| 11 | } |
| 12 | |
| 13 | long ServiceFS::ResolveServiceName(FancyRefPtr<Service>& ref, const char* name){ |
| 14 | const char* separator = strchr(name, '/'); |
| 15 | |
| 16 | if(separator){ |
| 17 | for(auto& svc : services){ |
| 18 | if(strncmp(svc->GetName(), name, separator - name) == 0){ |
| 19 | ref = svc; |
| 20 | return 0; |
| 21 | } |
| 22 | } |
| 23 | } else { |
| 24 | for(auto& svc : services){ |
| 25 | if(strcmp(svc->GetName(), name) == 0){ |
| 26 | ref = svc; |
| 27 | return 0; |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | //Log::Warning("Service %s not found!", name); |
| 33 | return 1; |
| 34 | } |
| 35 | |
| 36 | FancyRefPtr<Service> ServiceFS::CreateService(const char* name){ |
| 37 | auto svc = FancyRefPtr<Service>(new Service(name)); |
no test coverage detected