added: created directory 'content' which has Content:: files

added:   created directory 'templates' which has Templates:: and TemplatesFunctions:: files
changed: content.cpp split into many files (directory 'content')
changed: templates.cpp split into many files (directory 'templates')
added:   full permissions
changed: building of the program (GNU make is used now)
         Makefile and Makefile.dep added into directories
added:   a parser 'FunctionParser'
         is used to parse the GET string
         it recognizes directories, items, functions, functions parameters
added:   other classes: Function, Functions 
added:   function: ls, privileges
changed: function 'id' to 'node'
changed: version: to 0.2.0
added/changed: a lot of work have been done


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@469 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2008-12-30 01:05:03 +00:00
parent fac60a197b
commit 3e328932fc
62 changed files with 3457 additions and 1617 deletions

View File

@@ -31,8 +31,54 @@ static char buffer[50];
void SetUrlSubjectFromSubject(Item & item)
bool CorrectUrlChar(char c)
{
if( (c >= 'a' && c <='z') ||
(c >= 'A' && c <='Z') ||
(c >= '0' && c <='9') ||
(c == '(' || c == ')' || c == '.' || c == ',' || c == '_' )
)
{
return true;
}
return false;
}
void CorrectUrl(Item & item)
{
std::string::iterator i;
for(i = item.url.begin(); i!=item.url.end() ; ++i)
{
if( !CorrectUrlChar(*i) )
{
int c = ChangeLocalChar(*i);
if( CorrectUrlChar(c) )
*i = c;
else
*i = '_';
}
}
if( item.url.empty() )
item.url = "bez_nazwy"; // !! wrzucic do pliku konfiguracyjnego
else
if( item.url[0] >= '0' && item.url[0] <= '9' )
// url must begin with a letter
item.url.insert(item.url.begin(), '_');
}
void SetUrlFromSubject(Item & item)
{
item.url = item.subject;
CorrectUrl(item);
/*
std::string::iterator i;
item.url.clear();
@@ -59,10 +105,12 @@ std::string::iterator i;
if( item.url[0] >= '0' && item.url[0] <= '9' )
// url must begin with a letter
item.url.insert(item.url.begin(), '_');
*/
}
int polish_letters_simple[] =
{ 'a', 'A',
'c', 'C',
@@ -108,7 +156,7 @@ return c;
}
void HtmlSpecial(std::ostringstream & out, const std::string & in)
void HtmlEscape(std::ostringstream & out, const std::string & in)
{
std::string::const_iterator i;
@@ -128,11 +176,11 @@ std::string::const_iterator i;
}
std::string HtmlSpecial(const std::string & in)
std::string HtmlEscape(const std::string & in)
{
std::ostringstream out;
HtmlSpecial(out, in);
HtmlEscape(out, in);
return out.str();
}