63 lines
1.7 KiB
C++
Executable File
63 lines
1.7 KiB
C++
Executable File
/*
|
|
* This file is a part of CMSLU -- Content Management System like Unix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
|
* All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#ifndef headerfilecmslucoremisc
|
|
#define headerfilecmslucoremisc
|
|
|
|
|
|
#include <string>
|
|
#include <sstream>
|
|
#include <ctime>
|
|
#include "item.h"
|
|
|
|
#define MAJOR_VER 0
|
|
#define MINOR_VER 2
|
|
#define REVISION_VER 0
|
|
|
|
|
|
void ToString(std::string & s, int value);
|
|
void ToString(std::string & s, long value);
|
|
int ChangeLocalChar(unsigned char c);
|
|
|
|
bool CorrectUrlChar(char c);
|
|
void CorrectUrlDots(std::string & url);
|
|
void CorrectUrlChars(std::string & url);
|
|
void CorrectUrlOnlyAllowedChar(std::string & url);
|
|
|
|
void HtmlEscape(std::ostringstream & out, const std::string & in);
|
|
void HtmlEscapeFormTxt(std::ostringstream & out, const std::string & in);
|
|
std::string HtmlEscape(const std::string & in);
|
|
std::string HtmlEscapeFormTxt(const std::string & in);
|
|
|
|
const char * DateToStr(int year, int month, int day, int hour, int min, int sec);
|
|
const char * DateToStr(tm * ptm);
|
|
const char * DateToStr(time_t t);
|
|
|
|
const char * DateToStrCookie(int year, int month, int day, int hour, int min, int sec);
|
|
const char * DateToStrCookie(tm * ptm);
|
|
const char * DateToStrCookie(time_t t);
|
|
|
|
const char * IpToStr(unsigned int ip_);
|
|
|
|
bool IsWhite(int s);
|
|
void TrimWhite(std::string & s);
|
|
void Trim(std::string & s, char c);
|
|
int ToSmall(int c);
|
|
void ToSmall(std::string & s);
|
|
const char * SkipWhite(const char * s);
|
|
const char * ToStr(int value);
|
|
|
|
bool IsSubString(const char * short_str, const char * long_str);
|
|
bool IsSubStringNoCase(const char * short_str, const char * long_str);
|
|
|
|
|
|
bool ValidateEmail(const std::string & email);
|
|
|
|
#endif
|