db/update/ExcludeList: move code to ParseLine()
This commit is contained in:
		| @@ -35,14 +35,9 @@ | |||||||
| #include <assert.h> | #include <assert.h> | ||||||
| #include <string.h> | #include <string.h> | ||||||
|  |  | ||||||
| bool | inline void | ||||||
| ExcludeList::LoadFile(Path path_fs) noexcept | ExcludeList::ParseLine(char *line) noexcept | ||||||
| try { | { | ||||||
| #ifdef HAVE_CLASS_GLOB |  | ||||||
| 	TextFile file(path_fs); |  | ||||||
|  |  | ||||||
| 	char *line; |  | ||||||
| 	while ((line = file.ReadLine()) != nullptr) { |  | ||||||
| 	char *p = strchr(line, '#'); | 	char *p = strchr(line, '#'); | ||||||
| 	if (p != nullptr) | 	if (p != nullptr) | ||||||
| 		*p = 0; | 		*p = 0; | ||||||
| @@ -50,7 +45,17 @@ try { | |||||||
| 	p = Strip(line); | 	p = Strip(line); | ||||||
| 	if (*p != 0) | 	if (*p != 0) | ||||||
| 		patterns.emplace_front(p); | 		patterns.emplace_front(p); | ||||||
| 	} | } | ||||||
|  |  | ||||||
|  | bool | ||||||
|  | ExcludeList::LoadFile(Path path_fs) noexcept | ||||||
|  | try { | ||||||
|  | #ifdef HAVE_CLASS_GLOB | ||||||
|  | 	TextFile file(path_fs); | ||||||
|  |  | ||||||
|  | 	char *line; | ||||||
|  | 	while ((line = file.ReadLine()) != nullptr) | ||||||
|  | 		ParseLine(line); | ||||||
| #else | #else | ||||||
| 	/* not implemented */ | 	/* not implemented */ | ||||||
| 	(void)path_fs; | 	(void)path_fs; | ||||||
|   | |||||||
| @@ -69,6 +69,9 @@ public: | |||||||
| 	 * the specified file name. | 	 * the specified file name. | ||||||
| 	 */ | 	 */ | ||||||
| 	bool Check(Path name_fs) const noexcept; | 	bool Check(Path name_fs) const noexcept; | ||||||
|  |  | ||||||
|  | private: | ||||||
|  | 	void ParseLine(char *line) noexcept; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann