[cmake-commits] hoffman committed SystemInformation.cxx 1.4 1.5
SystemInformation.hxx.in 1.5 1.6
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Jan 30 21:40:45 EST 2008
Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv22654
Modified Files:
SystemInformation.cxx SystemInformation.hxx.in
Log Message:
COMP: use kwsys_stl and not std::
Index: SystemInformation.hxx.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemInformation.hxx.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- SystemInformation.hxx.in 30 Jan 2008 17:55:59 -0000 1.5
+++ SystemInformation.hxx.in 31 Jan 2008 02:40:43 -0000 1.6
@@ -172,7 +172,6 @@
void RunMemoryCheck();
-protected:
typedef struct tagID
{
@@ -233,6 +232,7 @@
{
AMD, Intel, NSC, UMC, Cyrix, NexGen, IDT, Rise, Transmeta, Sun, UnknownManufacturer
};
+protected:
// Functions.
bool RetrieveCPUFeatures();
@@ -263,7 +263,7 @@
// For Linux
int RetreiveInformationFromCpuInfoFile();
- std::string ExtractValueFromCpuInfoFile(std::string buffer,
+ kwsys_stl::string ExtractValueFromCpuInfoFile(kwsys_stl::string buffer,
const char* word, int init=0);
static void Delay (unsigned int);
@@ -273,13 +273,13 @@
// For Mac
bool ParseSysCtl();
- std::string ExtractValueFromSysCtl(const char* word);
- std::string SysCtlBuffer;
+ kwsys_stl::string ExtractValueFromSysCtl(const char* word);
+ kwsys_stl::string SysCtlBuffer;
// For Solaris
bool QuerySolarisInfo();
- std::string ParseValueFromKStat(const char* arguments);
- std::string RunProcess(std::vector<const char*> args);
+ kwsys_stl::string ParseValueFromKStat(const char* arguments);
+ kwsys_stl::string RunProcess(kwsys_stl::vector<const char*> args);
// Evaluate the memory information.
int QueryMemory();
@@ -292,11 +292,11 @@
// Operating System information
bool QueryOSInformation();
- std::string OSName;
- std::string Hostname;
- std::string OSRelease ;
- std::string OSVersion;
- std::string OSPlatform;
+ kwsys_stl::string OSName;
+ kwsys_stl::string Hostname;
+ kwsys_stl::string OSRelease ;
+ kwsys_stl::string OSVersion;
+ kwsys_stl::string OSPlatform;
};
} // namespace @KWSYS_NAMESPACE@
Index: SystemInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemInformation.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- SystemInformation.cxx 8 Jan 2008 22:51:05 -0000 1.4
+++ SystemInformation.cxx 31 Jan 2008 02:40:43 -0000 1.5
@@ -1671,7 +1671,7 @@
}
/** Extract a value from the CPUInfo file */
-std::string SystemInformation::ExtractValueFromCpuInfoFile(std::string buffer,const char* word,int init)
+kwsys_stl::string SystemInformation::ExtractValueFromCpuInfoFile(kwsys_stl::string buffer,const char* word,int init)
{
long int pos = buffer.find(word,init);
if(pos != -1)
@@ -1693,12 +1693,12 @@
{
this->NumberOfLogicalCPU = 0;
this->NumberOfPhysicalCPU = 0;
- std::string buffer;
+ kwsys_stl::string buffer;
FILE *fd = fopen("/proc/cpuinfo", "r" );
if ( !fd )
{
- kwsys_ios::cout << "Problem opening /proc/cpuinfo" << std::endl;
+ kwsys_ios::cout << "Problem opening /proc/cpuinfo" << kwsys_stl::endl;
return 0;
}
@@ -1723,7 +1723,7 @@
// Count the number of physical ids that are the same
int currentId = -1;
- std::string idc = this->ExtractValueFromCpuInfoFile(buffer,"physical id");
+ kwsys_stl::string idc = this->ExtractValueFromCpuInfoFile(buffer,"physical id");
while(this->CurrentPositionInFile>0)
{
@@ -1742,7 +1742,7 @@
}
// CPU speed (checking only the first proc
- std::string CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"cpu MHz");
+ kwsys_stl::string CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"cpu MHz");
this->CPUSpeedInMHz = (float)atof(CPUSpeed.c_str());
// Chip family
@@ -1757,7 +1757,7 @@
this->RetrieveClassicalCPUIdentity();
// L1 Cache size
- std::string cacheSize = this->ExtractValueFromCpuInfoFile(buffer,"cache size");
+ kwsys_stl::string cacheSize = this->ExtractValueFromCpuInfoFile(buffer,"cache size");
pos = cacheSize.find(" KB");
if(pos!=-1)
{
@@ -1807,7 +1807,7 @@
int errorFlag = uname(&unameInfo);
if( errorFlag!=0 )
{
- std::cout << "Problem calling uname(): " << strerror(errno) << std::endl;
+ kwsys_stl::cout << "Problem calling uname(): " << strerror(errno) << kwsys_stl::endl;
return 0;
}
@@ -1831,7 +1831,7 @@
FILE *fd = fopen("/proc/meminfo", "r" );
if ( !fd )
{
- std::cout << "Problem opening /proc/meminfo" << std::endl;
+ kwsys_stl::cout << "Problem opening /proc/meminfo" << kwsys_stl::endl;
return 0;
}
@@ -2228,7 +2228,7 @@
bool SystemInformation::ParseSysCtl()
{
// Extract the arguments from the command line
- std::vector<const char*> args;
+ kwsys_stl::vector<const char*> args;
args.push_back("sysctl");
args.push_back("-a");
args.push_back(0);
@@ -2271,7 +2271,7 @@
}
/** Extract a value from sysctl command */
-std::string SystemInformation::ExtractValueFromSysCtl(const char* word)
+kwsys_stl::string SystemInformation::ExtractValueFromSysCtl(const char* word)
{
long int pos = this->SysCtlBuffer.find(word);
if(pos != -1)
@@ -2287,9 +2287,9 @@
}
/** Run a given process */
-std::string SystemInformation::RunProcess(std::vector<const char*> args)
+kwsys_stl::string SystemInformation::RunProcess(kwsys_stl::vector<const char*> args)
{
- std::string buffer = "";
+ kwsys_stl::string buffer = "";
// Run the application
kwsysProcess* gp = kwsysProcess_New();
@@ -2320,12 +2320,12 @@
} break;
case kwsysProcess_State_Error:
{
- std::cerr << "Error: Could not run " << args[0] << ":\n";
- std::cerr << kwsysProcess_GetErrorString(gp) << "\n";
+ kwsys_stl::cerr << "Error: Could not run " << args[0] << ":\n";
+ kwsys_stl::cerr << kwsysProcess_GetErrorString(gp) << "\n";
} break;
case kwsysProcess_State_Exception:
{
- std::cerr << "Error: " << args[0]
+ kwsys_stl::cerr << "Error: " << args[0]
<< " terminated with an exception: "
<< kwsysProcess_GetExceptionString(gp) << "\n";
} break;
@@ -2335,8 +2335,8 @@
case kwsysProcess_State_Killed:
{
// Should not get here.
- std::cerr << "Unexpected ending state after running " << args[0]
- << std::endl;
+ kwsys_stl::cerr << "Unexpected ending state after running " << args[0]
+ << kwsys_stl::endl;
} break;
}
kwsysProcess_Delete(gp);
@@ -2345,14 +2345,14 @@
}
-std::string SystemInformation::ParseValueFromKStat(const char* arguments)
+kwsys_stl::string SystemInformation::ParseValueFromKStat(const char* arguments)
{
- std::vector<const char*> args;
+ kwsys_stl::vector<const char*> args;
args.clear();
args.push_back("kstat");
args.push_back("-p");
- std::string command = arguments;
+ kwsys_stl::string command = arguments;
long int start = -1;
long int pos = command.find(' ',0);
while(pos!=-1)
@@ -2374,7 +2374,7 @@
if(!inQuotes)
{
- std::string arg = command.substr(start+1,pos-start-1);
+ kwsys_stl::string arg = command.substr(start+1,pos-start-1);
// Remove the quotes if any
long int quotes = arg.find('"');
@@ -2388,14 +2388,14 @@
}
pos = command.find(' ',pos+1);
}
- std::string lastArg = command.substr(start+1,command.size()-start-1);
+ kwsys_stl::string lastArg = command.substr(start+1,command.size()-start-1);
args.push_back(lastArg.c_str());
args.push_back(0);
- std::string buffer = this->RunProcess(args);
+ kwsys_stl::string buffer = this->RunProcess(args);
- std::string value = "";
+ kwsys_stl::string value = "";
for(unsigned int i=buffer.size()-1;i>0;i--)
{
if(buffer[i] == ' ' || buffer[i] == '\t')
@@ -2404,7 +2404,7 @@
}
if(buffer[i] != '\n' && buffer[i] != '\r')
{
- std::string val = value;
+ kwsys_stl::string val = value;
value = buffer[i];
value += val;
}
More information about the Cmake-commits
mailing list