Mercurial > hg > orthanc
comparison Core/Toolbox.cpp @ 2017:08ce34cfacad
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 13 Jun 2016 15:49:10 +0200 |
parents | 4dafe2a0d3ab |
children | 35ccba7adae9 |
comparison
equal
deleted
inserted
replaced
2016:0ae26237569a | 2017:08ce34cfacad |
---|---|
1478 { | 1478 { |
1479 } | 1479 } |
1480 | 1480 |
1481 return false; | 1481 return false; |
1482 } | 1482 } |
1483 | |
1484 | |
1485 FILE* Toolbox::OpenFile(const std::string& path, | |
1486 FileMode mode) | |
1487 { | |
1488 #if defined(_WIN32) | |
1489 // TODO Deal with special characters by converting to the current locale | |
1490 #endif | |
1491 | |
1492 const char* m; | |
1493 switch (mode) | |
1494 { | |
1495 case FileMode_ReadBinary: | |
1496 m = "rb"; | |
1497 break; | |
1498 | |
1499 case FileMode_WriteBinary: | |
1500 m = "wb"; | |
1501 break; | |
1502 | |
1503 default: | |
1504 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
1505 } | |
1506 | |
1507 return fopen(path.c_str(), m); | |
1508 } | |
1483 } | 1509 } |
1484 |