мелочь
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -8,9 +8,9 @@
|
||||
#ifndef DP25_H_
|
||||
#define DP25_H_
|
||||
|
||||
#include "Printers/Printer.h"
|
||||
#include "ComPort.h"
|
||||
#include "SocketPort.h"
|
||||
#include "devices/Printers/Printer.h"
|
||||
#include "devices/ComPort.h"
|
||||
#include "devices/SocketPort.h"
|
||||
|
||||
#define fcDisplayClear 0x21 //(33)Очистка дисплея
|
||||
#define fcDisplayLower 0x23 //(35)Вывод текста в нижнюю строку дисплея
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
#include <iostream>
|
||||
#include <fstream> // std::ifstream
|
||||
#include <sstream>
|
||||
#include <cwctype> // For std::towlower
|
||||
#include <algorithm>
|
||||
|
||||
#include "inifile.h"
|
||||
#include "stdTools.h"
|
||||
@ -374,6 +376,7 @@ JSON::JSON(std::wstring data)
|
||||
|
||||
Utility::CutBeforeWFirst(data, '"');
|
||||
std::wstring ident = Utility::CutBeforeWFirst(data, '"');
|
||||
std::transform(ident.begin(), ident.end(), ident.begin(), ::tolower);
|
||||
std::wstring value;
|
||||
|
||||
size_t startpos = data.find_first_not_of(L" :\t\f\n\r");
|
||||
@ -438,6 +441,8 @@ std::string JSON::ReadAString(std::wstring Ident,std::wstring Default)
|
||||
//------------------------------------------------------------------------------
|
||||
std::wstring JSON::ReadString(std::wstring Ident,std::wstring Default)
|
||||
{
|
||||
std::transform(Ident.begin(), Ident.end(), Ident.begin(), ::tolower);
|
||||
|
||||
TIniWStruct* inistr = first;
|
||||
while (inistr!=NULL)
|
||||
{
|
||||
|
||||
@ -1531,7 +1531,7 @@ namespace Utility
|
||||
//Преобразовать строку в число
|
||||
//str - Исходная строка с числом
|
||||
//cutInt - вырезать из строки только цифры
|
||||
int StdStrToUInt(std::string& str, bool cutInt)
|
||||
uint32_t StdStrToUInt(std::string& str, bool cutInt, uint32_t def)
|
||||
{
|
||||
if(cutInt)
|
||||
{
|
||||
@ -1541,10 +1541,10 @@ namespace Utility
|
||||
if(str[i]=='0' || str[i]=='1' || str[i]=='2' || str[i]=='3' || str[i]=='4' || str[i]=='5' || str[i]=='6' || str[i]=='7' || str[i]=='8' || str[i]=='9')
|
||||
val+=str[i];
|
||||
}
|
||||
if(val=="") return 0;
|
||||
if(val=="") return def;
|
||||
return fromString<int>(val);
|
||||
}
|
||||
if(str=="") return 0;
|
||||
if(str=="") return def;
|
||||
return fromString<int>(str);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
@ -2220,12 +2220,13 @@ namespace Utility
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
//Создать папку
|
||||
bool createFolder(std::string directory,mode_t mode)
|
||||
bool createFolder(std::string directory,int mode)
|
||||
{
|
||||
#if defined(_WIN32) || defined(_WINDOWS) || defined(_BORLAND)
|
||||
CreateDirectoryA(directory.c_str(), NULL);
|
||||
return true;
|
||||
#else
|
||||
mode_t tmp = mode; //На винде тен типа mode_t
|
||||
int rez=0;
|
||||
if(!dirExists(directory)){
|
||||
rez=mkdir(directory.c_str(), mode); //Если папки нет то создать её
|
||||
|
||||
@ -127,7 +127,7 @@ namespace Utility
|
||||
|
||||
bool fileExists(std::string name);
|
||||
bool dirExists(std::string path);
|
||||
bool createFolder(std::string directory,mode_t mode=0776); //Создать директорию
|
||||
bool createFolder(std::string directory,int mode=0776); //Создать директорию
|
||||
long getFileSize(std::string filename);
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ namespace Utility
|
||||
template<typename T>
|
||||
T fromString(const std::string& s);
|
||||
int StdStrToInt(std::string& str, bool cutInt = false, int def = 0);
|
||||
int StdStrToUInt(std::string& str, bool cutInt = false);
|
||||
uint32_t StdStrToUInt(std::string& str, bool cutInt = false, int def = 0);
|
||||
float StdStrToFloat(std::string& str);
|
||||
double StdStrToDouble(std::string& str,double defval = 0);
|
||||
double StdWStrToDouble(std::wstring str, double defval = 0);
|
||||
|
||||
Reference in New Issue
Block a user