OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkRTConf.h" | 8 #include "SkRTConf.h" |
9 #include "SkOSFile.h" | 9 #include "SkOSFile.h" |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 if (configFileSize == 0) { | 69 if (configFileSize == 0) { |
70 printAll(path); | 70 printAll(path); |
71 } | 71 } |
72 sk_fclose(fp); | 72 sk_fclose(fp); |
73 } | 73 } |
74 | 74 |
75 // Run through every provided configuration option and print a warning if the us
er hasn't | 75 // Run through every provided configuration option and print a warning if the us
er hasn't |
76 // declared a correponding configuration object somewhere. | 76 // declared a correponding configuration object somewhere. |
77 void SkRTConfRegistry::validate() const { | 77 void SkRTConfRegistry::validate() const { |
78 for (int i = 0 ; i < fConfigFileKeys.count() ; i++) { | 78 for (int i = 0 ; i < fConfigFileKeys.count() ; i++) { |
79 if (fConfs.find(fConfigFileKeys[i]->c_str())) { | 79 if (!fConfs.find(fConfigFileKeys[i]->c_str())) { |
80 SkDebugf("WARNING: You have config value %s in your configuration fi
le, but I've never heard of that.\n", fConfigFileKeys[i]->c_str()); | 80 SkDebugf("WARNING: You have config value %s in your configuration fi
le, but I've never heard of that.\n", fConfigFileKeys[i]->c_str()); |
81 } | 81 } |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 void SkRTConfRegistry::printAll(const char *fname) const { | 85 void SkRTConfRegistry::printAll(const char *fname) const { |
86 SkWStream *o; | 86 SkWStream *o; |
87 | 87 |
88 if (NULL != fname) { | 88 if (NULL != fname) { |
89 o = new SkFILEWStream(fname); | 89 o = new SkFILEWStream(fname); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 template void SkRTConfRegistry::set(const char *name, int value); | 286 template void SkRTConfRegistry::set(const char *name, int value); |
287 template void SkRTConfRegistry::set(const char *name, unsigned int value); | 287 template void SkRTConfRegistry::set(const char *name, unsigned int value); |
288 template void SkRTConfRegistry::set(const char *name, float value); | 288 template void SkRTConfRegistry::set(const char *name, float value); |
289 template void SkRTConfRegistry::set(const char *name, double value); | 289 template void SkRTConfRegistry::set(const char *name, double value); |
290 template void SkRTConfRegistry::set(const char *name, char * value); | 290 template void SkRTConfRegistry::set(const char *name, char * value); |
291 | 291 |
292 SkRTConfRegistry &skRTConfRegistry() { | 292 SkRTConfRegistry &skRTConfRegistry() { |
293 static SkRTConfRegistry r; | 293 static SkRTConfRegistry r; |
294 return r; | 294 return r; |
295 } | 295 } |
OLD | NEW |