Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 11, 2011, 7:37:00 PM (14 years ago)
Author:
dafrick
Message:

Extending and reorganizing ScreenshotManager and SkyboxGenerator.
The SkyboxGenerator now takes HD screenshots, thus the size of the faces generated by the SkyboxGenerator can now be specified freely (through a config value).

Location:
code/trunk/src/libraries/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/util/StringUtils.cc

    r7401 r8232  
    3535
    3636#include <cctype>
     37#include <ctime>
    3738#include <boost/scoped_array.hpp>
    3839#include "Convert.h"
     
    516517        return matrix[(rows-1)*cols + cols-1];
    517518    }
     519   
     520    /**
     521    @brief
     522        Get a timestamp for the curent time instant.
     523    @return
     524        Returns a string with the timestamp.
     525    */
     526    std::string getTimestamp(void)
     527    {
     528        struct tm *pTime;
     529        time_t ctTime; std::time(&ctTime);
     530        pTime = std::localtime( &ctTime );
     531        std::ostringstream oss;
     532        oss << std::setw(2) << std::setfill('0') << (pTime->tm_mon + 1)
     533            << std::setw(2) << std::setfill('0') << pTime->tm_mday
     534            << std::setw(2) << std::setfill('0') << (pTime->tm_year + 1900)
     535            << "_" << std::setw(2) << std::setfill('0') << pTime->tm_hour
     536            << std::setw(2) << std::setfill('0') << pTime->tm_min
     537            << std::setw(2) << std::setfill('0') << pTime->tm_sec;
     538        return oss.str();
     539    }
    518540}
  • code/trunk/src/libraries/util/StringUtils.h

    r7417 r8232  
    4848    extern _UtilExport std::string BLANKSTRING;
    4949
    50     _UtilExport std::string getUniqueNumberString();
     50    _UtilExport std::string  getUniqueNumberString();
    5151
    5252    _UtilExport void         strip(std::string* str);
     
    8888
    8989    _UtilExport unsigned int getLevenshteinDistance(const std::string& str1, const std::string& str2);
     90   
     91    _UtilExport std::string  getTimestamp(void);
    9092}
    9193
Note: See TracChangeset for help on using the changeset viewer.