Skip to content

Methods

Josh Miller edited this page Feb 10, 2015 · 68 revisions

Methods

Foster.cpp

Getters

Standard getter methods that return the member variables of a given cylonStruct, these include:

  • unsigned int getFosterMilliseconds(struct cylonStruct tf)
  • unsigned int getFosterSeconds(struct cylonStruct tf)
  • unsigned int getFosterMinutes(struct cylonStruct tf)
  • unsigned int getFosterHours(struct cylonStruct tf)
  • unsigned int getFosterDay(struct cylonStruct tf)
  • unsigned int getFosterDate(struct cylonStruct tf)
  • unsigned int getFosterMonth(struct cylonStruct tf)
  • unsigned int getFosterYear(struct cylonStruct tf)
  • long getFosterTimeZone(struct cylonStruct tf)
  • unsigned int getFosterDST(struct cylonStruct tf)
  • std::wstring getFosterTimeZoneName(struct cylonStruct tf)
  • std::wstring getFosterUsername(struct cylonStruct tf)
  • std::wstring getFosterDeviceName(struct cylonStruct tf)

Producers

Producer functions make calls to WinRT and supported Win32 API's to get relevant system, user and hardware information. After retrieving this information, these functions format and store the data in a given cylonStruct.

  • void produceUsername(struct cylonStruct& tf)

  • This function calls the Windows UserInformation GetDisplayNameAsync() method to retrieve the username of the current logged in user. To allow rapid refreshes of a cylonStruct, a blocking loop prevents the function from proceeding until the asynchronous response has replied with a result. Finally, the function converts the result into a wstring and stores it in the provided cylonStruct.

  • void produceTimeZone(struct cyclonStruct& tory)

  • This function calls the Windows method GetTimeZoneInformation, and stores the received bias and time zone names in the given cylonStruct. Additionally, a conversion is done on the DWORD result of the GetTimeZoneInformation call, and the result is stored as the dst member variable of the cylonStruct.

  • void produceDateTime(struct cylonStruct& tory)

  • This function calls the Windows method GetLocalTime, and stores the resulting responses for hours, minutes, seconds, milliseconds, day, date, month, and year in the provided cylonStruct.

  • void produceDeviceName(struct cylonStruct& tory)

  • This function calls a Windows socket WSAStartup, and makes a request for the host's name via gethostname. After receiving the host name, WSACleanup() is called. The method then converts the host name to a wstring and stores it in the provided cylonStruct.

  • void produceProcessorInfo(struct cylonStruct& tf)

  • This function calls the Windows GetNativeSystemInfo method.

Clone this wiki locally