Esempio n. 1
0
static String getAllSystemInfo()
{
    String systemInfo;

    systemInfo
      << "Here are a few system statistics..." << newLine
      << newLine
      << "Time and date:    " << Time::getCurrentTime().toString (true, true) << newLine
      << "System up-time:   " << RelativeTime::milliseconds ((int64) Time::getMillisecondCounterHiRes()).getDescription() << newLine
      << "Compilation date: " << Time::getCompilationDate().toString (true, false) << newLine
      << newLine
      << "Operating system: " << SystemStats::getOperatingSystemName() << newLine
      << "Host name:        " << SystemStats::getComputerName() << newLine
      << "Device type:      " << SystemStats::getDeviceDescription() << newLine
      << "User logon name:  " << SystemStats::getLogonName() << newLine
      << "Full user name:   " << SystemStats::getFullUserName() << newLine
      << "User region:      " << SystemStats::getUserRegion() << newLine
      << "User language:    " << SystemStats::getUserLanguage() << newLine
      << "Display language: " << SystemStats::getDisplayLanguage() << newLine
      << newLine
      << "Number of CPUs: " << SystemStats::getNumCpus() << newLine
      << "Memory size:    " << SystemStats::getMemorySizeInMegabytes() << " MB" << newLine
      << "CPU vendor:     " << SystemStats::getCpuVendor() << newLine
      << "CPU speed:      " << SystemStats::getCpuSpeedInMegaherz() << " MHz" << newLine
      << "CPU has MMX:    " << (SystemStats::hasMMX()   ? "yes" : "no") << newLine
      << "CPU has SSE:    " << (SystemStats::hasSSE()   ? "yes" : "no") << newLine
      << "CPU has SSE2:   " << (SystemStats::hasSSE2()  ? "yes" : "no") << newLine
      << "CPU has SSE3:   " << (SystemStats::hasSSE3()  ? "yes" : "no") << newLine
      << "CPU has 3DNOW:  " << (SystemStats::has3DNow() ? "yes" : "no") << newLine
      << newLine
      << "Current working directory:  " << File::getCurrentWorkingDirectory().getFullPathName() << newLine
      << "Current application file:   " << File::getSpecialLocation (File::currentApplicationFile).getFullPathName() << newLine
      << "Current executable file:    " << File::getSpecialLocation (File::currentExecutableFile) .getFullPathName() << newLine
      << "Invoked executable file:    " << File::getSpecialLocation (File::invokedExecutableFile) .getFullPathName() << newLine
      << newLine
      << "User home folder:               " << File::getSpecialLocation (File::userHomeDirectory)             .getFullPathName() << newLine
      << "User desktop folder:            " << File::getSpecialLocation (File::userDesktopDirectory)          .getFullPathName() << newLine
      << "User documents folder:          " << File::getSpecialLocation (File::userDocumentsDirectory)        .getFullPathName() << newLine
      << "User application data folder:   " << File::getSpecialLocation (File::userApplicationDataDirectory)  .getFullPathName() << newLine
      << "User music folder:              " << File::getSpecialLocation (File::userMusicDirectory)            .getFullPathName() << newLine
      << "User movies folder:             " << File::getSpecialLocation (File::userMoviesDirectory)           .getFullPathName() << newLine
      << "User pictures folder:           " << File::getSpecialLocation (File::userPicturesDirectory)         .getFullPathName() << newLine
      << "Common application data folder: " << File::getSpecialLocation (File::commonApplicationDataDirectory).getFullPathName() << newLine
      << "Common documents folder:        " << File::getSpecialLocation (File::commonDocumentsDirectory)      .getFullPathName() << newLine
      << "Local temp folder:              " << File::getSpecialLocation (File::tempDirectory)                 .getFullPathName() << newLine
      << newLine
      << "File System roots: "          << getFileSystemRoots() << newLine
      << "Free space in home folder: "  << File::descriptionOfSizeInBytes (File::getSpecialLocation (File::userHomeDirectory)
                                                                                .getBytesFreeOnVolume()) << newLine
      << newLine
      << getDisplayInfo() << newLine
      << "Network IP addresses: " << newLine << getIPAddressList() << newLine
      << "Network card MAC addresses: " << newLine << getMacAddressList() << newLine;

    DBG (systemInfo);
    return systemInfo;
}
Esempio n. 2
0
    //==============================================================================
    // this little function just demonstrates a few system info calls
    static String collectSomeSystemInfo()
    {
        String systemInfo;

        systemInfo
          << "Time and date: " << Time::getCurrentTime().toString (true, true) << newLine

          << "User logon name: "  << SystemStats::getLogonName() << newLine
          << "Full user name: "   << SystemStats::getFullUserName() << newLine
          << "Host name: "        << SystemStats::getComputerName() << newLine
          << "Operating system: " << SystemStats::getOperatingSystemName() << newLine
          << "Locale: "           << SystemStats::getUserLanguage() << "-" << SystemStats::getUserRegion() << newLine

          << "Memory size: "    << SystemStats::getMemorySizeInMegabytes() << "MB" << newLine
          << "Number of CPUs: " << SystemStats::getNumCpus() << newLine
          << "CPU vendor: "     << SystemStats::getCpuVendor() << newLine
          << "CPU speed: "      << SystemStats::getCpuSpeedInMegaherz() << "MHz" << newLine
          << "CPU has MMX: "    << (SystemStats::hasMMX()   ? "yes" : "no") << newLine
          << "CPU has SSE: "    << (SystemStats::hasSSE()   ? "yes" : "no") << newLine
          << "CPU has SSE2: "   << (SystemStats::hasSSE2()  ? "yes" : "no") << newLine
          << "CPU has SSE3: "   << (SystemStats::hasSSE3()  ? "yes" : "no") << newLine
          << "CPU has 3DNOW: "  << (SystemStats::has3DNow() ? "yes" : "no") << newLine

          << "Found network card MAC addresses: " << getMacAddressList() << newLine
          << "Found IP addresses: " << getIPAddressList() << newLine

          << "Current working directory: "         << File::getCurrentWorkingDirectory().getFullPathName() << newLine
          << "Current executable file: "           << File::getSpecialLocation (File::currentExecutableFile).getFullPathName() << newLine
          << "Current application file: "          << File::getSpecialLocation (File::currentApplicationFile).getFullPathName() << newLine
          << "User home directory: "               << File::getSpecialLocation (File::userHomeDirectory).getFullPathName() << newLine
          << "User documents directory: "          << File::getSpecialLocation (File::userDocumentsDirectory).getFullPathName() << newLine
          << "User application data directory: "   << File::getSpecialLocation (File::userApplicationDataDirectory).getFullPathName() << newLine
          << "Common application data directory: " << File::getSpecialLocation (File::commonApplicationDataDirectory).getFullPathName() << newLine
          << "Temp directory: "                    << File::getSpecialLocation (File::tempDirectory).getFullPathName() << newLine
          << newLine;

        return systemInfo;
    }