style(3p/nix): Remove 'using std::*' from types.hh
It is considered bad form to use things from includes in headers, as these directives propagate to everywhere else and can make it confusing. types.hh (which is includes almost literally everywhere) had some of these directives, which this commit removes.
This commit is contained in:
		
							parent
							
								
									f30b2e610d
								
							
						
					
					
						commit
						838f86b0fd
					
				
					 85 changed files with 859 additions and 821 deletions
				
			
		
							
								
								
									
										30
									
								
								third_party/nix/src/libutil/archive.cc
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										30
									
								
								third_party/nix/src/libutil/archive.cc
									
										
									
									
										vendored
									
									
								
							|  | @ -38,7 +38,7 @@ static GlobalConfig::Register r1(&archiveSettings); | |||
| 
 | ||||
| const std::string narVersionMagic1 = "nix-archive-1"; | ||||
| 
 | ||||
| static string caseHackSuffix = "~nix~case~hack~"; | ||||
| static std::string caseHackSuffix = "~nix~case~hack~"; | ||||
| 
 | ||||
| PathFilter defaultPathFilter = [](const Path& /*unused*/) { return true; }; | ||||
| 
 | ||||
|  | @ -89,12 +89,12 @@ static void dump(const Path& path, Sink& sink, PathFilter& filter) { | |||
| 
 | ||||
|     /* If we're on a case-insensitive system like macOS, undo
 | ||||
|        the case hack applied by restorePath(). */ | ||||
|     std::map<string, string> unhacked; | ||||
|     std::map<std::string, std::string> unhacked; | ||||
|     for (auto& i : readDirectory(path)) { | ||||
|       if (archiveSettings.useCaseHack) { | ||||
|         string name(i.name); | ||||
|         std::string name(i.name); | ||||
|         size_t pos = i.name.find(caseHackSuffix); | ||||
|         if (pos != string::npos) { | ||||
|         if (pos != std::string::npos) { | ||||
|           DLOG(INFO) << "removing case hack suffix from " << path << "/" | ||||
|                      << i.name; | ||||
| 
 | ||||
|  | @ -145,7 +145,7 @@ void dumpString(const std::string& s, Sink& sink) { | |||
|        << "contents" << s << ")"; | ||||
| } | ||||
| 
 | ||||
| static SerialisationError badArchive(const string& s) { | ||||
| static SerialisationError badArchive(const std::string& s) { | ||||
|   return SerialisationError("bad archive: " + s); | ||||
| } | ||||
| 
 | ||||
|  | @ -182,13 +182,13 @@ static void parseContents(ParseSink& sink, Source& source, const Path& path) { | |||
| } | ||||
| 
 | ||||
| struct CaseInsensitiveCompare { | ||||
|   bool operator()(const string& a, const string& b) const { | ||||
|   bool operator()(const std::string& a, const std::string& b) const { | ||||
|     return strcasecmp(a.c_str(), b.c_str()) < 0; | ||||
|   } | ||||
| }; | ||||
| 
 | ||||
| static void parse(ParseSink& sink, Source& source, const Path& path) { | ||||
|   string s; | ||||
|   std::string s; | ||||
| 
 | ||||
|   s = readString(source); | ||||
|   if (s != "(") { | ||||
|  | @ -212,7 +212,7 @@ static void parse(ParseSink& sink, Source& source, const Path& path) { | |||
|       if (type != tpUnknown) { | ||||
|         throw badArchive("multiple type fields"); | ||||
|       } | ||||
|       string t = readString(source); | ||||
|       std::string t = readString(source); | ||||
| 
 | ||||
|       if (t == "regular") { | ||||
|         type = tpRegular; | ||||
|  | @ -247,8 +247,8 @@ static void parse(ParseSink& sink, Source& source, const Path& path) { | |||
|     } | ||||
| 
 | ||||
|     else if (s == "entry" && type == tpDirectory) { | ||||
|       string name; | ||||
|       string prevName; | ||||
|       std::string name; | ||||
|       std::string prevName; | ||||
| 
 | ||||
|       s = readString(source); | ||||
|       if (s != "(") { | ||||
|  | @ -266,8 +266,8 @@ static void parse(ParseSink& sink, Source& source, const Path& path) { | |||
|         if (s == "name") { | ||||
|           name = readString(source); | ||||
|           if (name.empty() || name == "." || name == ".." || | ||||
|               name.find('/') != string::npos || | ||||
|               name.find((char)0) != string::npos) { | ||||
|               name.find('/') != std::string::npos || | ||||
|               name.find((char)0) != std::string::npos) { | ||||
|             throw Error(format("NAR contains invalid file name '%1%'") % name); | ||||
|           } | ||||
|           if (name <= prevName) { | ||||
|  | @ -297,7 +297,7 @@ static void parse(ParseSink& sink, Source& source, const Path& path) { | |||
|     } | ||||
| 
 | ||||
|     else if (s == "target" && type == tpSymlink) { | ||||
|       string target = readString(source); | ||||
|       std::string target = readString(source); | ||||
|       sink.createSymlink(path, target); | ||||
|     } | ||||
| 
 | ||||
|  | @ -308,7 +308,7 @@ static void parse(ParseSink& sink, Source& source, const Path& path) { | |||
| } | ||||
| 
 | ||||
| void parseDump(ParseSink& sink, Source& source) { | ||||
|   string version; | ||||
|   std::string version; | ||||
|   try { | ||||
|     version = readString(source, narVersionMagic1.size()); | ||||
|   } catch (SerialisationError& e) { | ||||
|  | @ -369,7 +369,7 @@ struct RestoreSink : ParseSink { | |||
|     writeFull(fd.get(), data, len); | ||||
|   } | ||||
| 
 | ||||
|   void createSymlink(const Path& path, const string& target) override { | ||||
|   void createSymlink(const Path& path, const std::string& target) override { | ||||
|     Path p = dstPath + path; | ||||
|     nix::createSymlink(target, p); | ||||
|   } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue