trunk/branch integration: source indentation

This commit is contained in:
Marian Krivos
2011-08-23 07:09:52 +00:00
parent 24a844d68b
commit a535226b86

View File

@@ -37,7 +37,9 @@
#include "Poco/TemporaryFile.h"
#include "Poco/Path.h"
#include "Poco/Exception.h"
#if !defined(POCO_VXWORKS)
#include "Poco/Process.h"
#endif
#include "Poco/Mutex.h"
#include <set>
#include <sstream>
@@ -83,12 +85,16 @@ private:
};
TemporaryFile::TemporaryFile(): File(tempName()), _keep(false)
TemporaryFile::TemporaryFile():
File(tempName()),
_keep(false)
{
}
TemporaryFile::TemporaryFile(const std::string& tempDir): File(tempName(tempDir)), _keep(false)
TemporaryFile::TemporaryFile(const std::string& tempDir):
File(tempName(tempDir)),
_keep(false)
{
}
@@ -122,23 +128,37 @@ void TemporaryFile::keepUntilExit()
}
void TemporaryFile::registerForDeletion(const std::string& path)
namespace
{
static TempFileCollector fc;
}
void TemporaryFile::registerForDeletion(const std::string& path)
{
fc.registerFile(path);
}
namespace
{
static FastMutex mutex;
}
std::string TemporaryFile::tempName(const std::string& tempDir)
{
std::ostringstream name;
static FastMutex mutex;
static unsigned long count = 0;
mutex.lock();
unsigned long n = count++;
mutex.unlock();
name << (tempDir.empty() ? Path::temp() : tempDir);
#if defined(POCO_VXWORKS)
name << "tmp";
#else
name << "tmp" << Process::id();
#endif
for (int i = 0; i < 6; ++i)
{
name << char('a' + (n % 26));