This commit is contained in:
Mirek Fidler 2023-10-03 19:43:53 +02:00
commit c673c75465
39 changed files with 6742 additions and 5259 deletions

View file

@ -0,0 +1,5 @@
* C:\upp\out\autotest\CLANGx64.Debug.Debug_Full\ParseXMLErrors.exe 03.10.2023 00:45:27, user: cxl
xml = <b> </b>
xml = </b>
e = Unexpected text

View file

@ -0,0 +1,20 @@
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_FILE | LOG_COUT);
for(const char *xml : { " <b> </b> ", "</b>" })
try {
DDUMP(xml);
ParseXML(xml);
}
catch(XmlError e)
{
DDUMP(e);
}
CheckLogEtalon();
}

View file

@ -0,0 +1,10 @@
uses
Core;
file
Etalon.log,
ParseXMLErrors.cpp;
mainconfig
"" = "";

View file

@ -1,25 +1,31 @@
<html><STYLE TYPE="text/css"><!--
.A{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:normal;font-style:normal;text-decoration:none;}
.B{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:bold;font-style:normal;text-decoration:none;}
.C{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:bold;font-style:italic;text-decoration:none;}
.D{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:bold;font-style:normal;text-decoration:underline}
.E{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:normal;font-style:normal;text-decoration:none;line-height:150%}
.F{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:normal;font-style:normal;text-decoration:none;line-height:200%}
.A{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:normal;font-style:normal;}
.B{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:bold;font-style:normal;}
.C{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:bold;font-style:italic;}
.D{font-weight:normal;font-style:normal;}
.E{font-style:normal;}
.F{font-weight:normal;}
.G{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:normal;font-style:normal;line-height:150%}
.H{margin:0px 0px 0px 0px;text-indent:0px;text-align:left;color:#000000;font-family:sans-serif;font-size:12pt;font-weight:normal;font-style:normal;line-height:200%}
-->
</STYLE>
<body><p class="A">Normal text</p>
<p class="B">Bold text</p>
<p class="C">Italic</p>
<p class="D">Underline</p>
<p class="B"><u>Underline</u></p>
<p class="B"> &nbsp;&nbsp;&nbsp;<u>Underline with indent</u></p>
<p class="A">&nbsp;</p>
<p class="C"><span class="D">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="E"><u>Underline</u></span><span class="E"> </span><span class="D">Normal text </span><span class="E">Bold text </span><span class="F">Italic </span><u>ALL</u></p>
<p class="B">&nbsp;</p>
<p class="A"> &nbsp;&nbsp;<del>Strikeout</del></p>
<p class="A">&nbsp;</p>
<p class="A">Standard paragraph. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Curabitur vitae diam non enim vestibulum interdum. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Integer tempor. Morbi leo mi, nonummy eget tristique non, rhoncus non leo. Phasellus rhoncus.</p>
<p class="A">&nbsp;</p>
<p class="A">&nbsp;</p>
<p class="E">1.5 line spacing. Vivamus porttitor turpis ac leo. Mauris dictum facilisis augue. Nam quis nulla. Curabitur ligula sapien, pulvinar a vestibulum quis, facilisis vel sapien. Vivamus ac leo pretium faucibus. Pellentesque arcu.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Curabitur vitae diam non enim vestibulum interdum. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Integer tempor. Morbi leo mi, nonummy eget tristique non, rhoncus non leo. Phasellus rhoncus.</p>
<p class="G">1.5 line spacing. Vivamus porttitor turpis ac leo. Mauris dictum facilisis augue. Nam quis nulla. Curabitur ligula sapien, pulvinar a vestibulum quis, facilisis vel sapien. Vivamus ac leo pretium faucibus. Pellentesque arcu.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Curabitur vitae diam non enim vestibulum interdum. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Integer tempor. Morbi leo mi, nonummy eget tristique non, rhoncus non leo. Phasellus rhoncus.</p>
<p class="A">&nbsp;</p>
<p class="F">2.0 line spacing. Pellentesque sapien. Nulla turpis magna, cursus sit amet, suscipit a, interdum id, felis. Integer in sapien. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse sagittis ultrices augue. Nullam lectus justo, vulputate eget mollis sed, tempor sed magna.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Curabitur vitae diam non enim vestibulum interdum. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Integer tempor. Morbi leo mi, nonummy eget tristique non, rhoncus non leo. Phasellus rhoncus.</p>
<p class="H">2.0 line spacing. Pellentesque sapien. Nulla turpis magna, cursus sit amet, suscipit a, interdum id, felis. Integer in sapien. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse sagittis ultrices augue. Nullam lectus justo, vulputate eget mollis sed, tempor sed magna.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Curabitur vitae diam non enim vestibulum interdum. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Integer tempor. Morbi leo mi, nonummy eget tristique non, rhoncus non leo. Phasellus rhoncus.</p>
<p class="A">&nbsp;</p>
<p class="A">&nbsp;</p>
</body></html>

View file

@ -4,7 +4,11 @@
[s0; [* Bold text]&]
[s0; [*/ Italic]&]
[s0; [*_ Underline]&]
[s0; [* ][*_ Underline with indent]&]
[s0; &]
[s0; -|[*_ Underline][* ]Normal text [* Bold text ][/ Italic ][*/_ ALL]&]
[s0;*_ &]
[s0; [- Strikeout]&]
[s0; &]
[s0; Standard paragraph. Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Mauris dictum facilisis augue. Lorem ipsum dolor

View file

@ -3,7 +3,7 @@
using namespace Upp;
struct MyApp : TopWindow {
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), White());
w.DrawRect(10, 10, 60, 80, Green());

View file

@ -5,7 +5,7 @@ using namespace Upp;
struct MyApp : TopWindow {
DropList font_list;
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
const String text = "Programming is fun";
Font fnt(~font_list, 60);

View file

@ -5,7 +5,7 @@ using namespace Upp;
struct MyApp : TopWindow {
Drawing drawing;
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), White());
w.DrawDrawing(10, 10, 50, 60, drawing);
w.DrawDrawing(100, 10, 150, 100, drawing);

View file

@ -5,7 +5,7 @@ using namespace Upp;
struct MyApp : TopWindow {
Image image;
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), Cyan());
w.DrawImage(10, 10, image);
}

View file

@ -3,7 +3,7 @@
using namespace Upp;
struct MyAppWindow : TopWindow {
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), SWhite());
w.DrawText(20, 20, "Hello world!", Arial(30), Magenta);
}

View file

@ -6,17 +6,17 @@ struct MyAppWindow : TopWindow {
Point p;
String text;
virtual void LeftDown(Point pos, dword flags) override {
void LeftDown(Point pos, dword flags) override {
p = pos;
Refresh();
}
virtual void MouseMove(Point pos, dword flags) override {
void MouseMove(Point pos, dword flags) override {
text = Format("[%d:%d]", pos.x, pos.y);
Refresh();
}
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), SWhite);
w.DrawText(p.x, p.y, text, Arial(20), Magenta);
}

View file

@ -8,7 +8,7 @@ struct MyAppWindow : TopWindow {
Break();
}
virtual void RightDown(Point, dword) override {
void RightDown(Point, dword) override {
MenuBar::Execute(
[=](Bar& bar) {
bar.Add("Exit", [=] { Exit(); });

View file

@ -8,7 +8,7 @@ struct MyAppWindow : TopWindow {
Break();
}
virtual void RightDown(Point, dword) override {
void RightDown(Point, dword) override {
int result = Null;
MenuBar menu;
for(int i = 0; i < 10; i++)

View file

@ -5,12 +5,12 @@ using namespace Upp;
struct MyCtrl : public Ctrl {
int count = 0;
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), White());
w.DrawText(2, 2, AsString(count));
}
virtual void LeftDown(Point, dword) override {
void LeftDown(Point, dword) override {
count++;
Refresh();
}

View file

@ -11,7 +11,7 @@ struct MyAppWindow : TopWindow {
Zoomable().Sizeable().SetRect(0, 0, 550, 100);
}
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), SLtYellow);
w.DrawText(20, 20, t_("Hello translation engine!"), Arial(30), Blue);
}

View file

@ -6,18 +6,19 @@ using namespace Upp;
#define IMAGEFILE <Image01/images.iml>
#include <Draw/iml.h>
class MyApp : public TopWindow {
public:
virtual void Paint(Draw& draw);
struct MyApp : TopWindow {
MyApp() {
const auto isz = MyImages::MyImage().GetSize();
SetRect(0, 0, 100 + isz.cx, 100 + isz.cy);
}
void Paint(Draw& w) override {
w.DrawRect(GetSize(), SColorFace());
w.DrawImage(50, 50, MyImages::MyImage());
}
};
void MyApp::Paint(Draw& w)
{
w.DrawRect(GetSize(), SColorFace());
w.DrawImage(50, 50, MyImages::MyImage());
}
GUI_APP_MAIN
{
MyApp().Sizeable().Run();
MyApp().Run();
}

View file

@ -6,27 +6,27 @@ using namespace Upp;
#define IMAGEFILE <Image02a/images.iml>
#include <Draw/iml.h>
class MyApp : public TopWindow {
public:
virtual void Paint(Draw& draw);
};
void MyApp::Paint(Draw& w)
{
w.DrawRect(GetSize(), SColorPaper());
for(int i = 0; i < MyImages::GetCount(); i++) {
w.DrawImage(50, 80 + 20 * i, MyImages::Get(i));
w.DrawText(80, 80 + 20 * i, MyImages::GetId(i));
struct MyApp : TopWindow {
MyApp() {
SetRect(0, 0, 170, 170);
}
w.DrawImage(20, 0, 50, 50, MyImages::Get(MyImages::I_Circle));
w.DrawText(80, 0, AsString(MyImages::Find("Circle")));
}
void Paint(Draw& w) override {
w.DrawRect(GetSize(), SColorPaper());
for(int i = 0; i < MyImages::GetCount(); i++) {
w.DrawImage(50, 80 + 20 * i, MyImages::Get(i));
w.DrawText(80, 80 + 20 * i, MyImages::GetId(i));
}
w.DrawImage(20, 0, 50, 50, MyImages::Get(MyImages::I_Circle));
w.DrawText(80, 0, AsString(MyImages::Find("Circle")));
}
};
GUI_APP_MAIN
{
MyApp().Sizeable().Run();
MyApp().Run();
Image m = MyImages::Circle();
MyImages::Set(MyImages::I_Circle, MyImages::Triangle());
MyImages::Set(MyImages::I_Triangle, m);
MyApp().Sizeable().Run();
MyApp().Run();
}

View file

@ -7,24 +7,24 @@ using namespace Upp;
#include <Draw/iml.h>
class MyApp : public TopWindow {
Iml& iml;
public:
virtual void Paint(Draw& draw);
MyApp(Iml& _iml) : iml(_iml) {}
};
void MyApp::Paint(Draw& w)
{
w.DrawRect(GetSize(), SColorPaper());
for(int i = 0; i < iml.GetCount(); i++) {
w.DrawImage(50, 80 + 20 * i, iml.Get(i));
w.DrawText(80, 80 + 20 * i, iml.GetId(i));
MyApp(Iml& iml) : m_iml(iml) {
SetRect(0, 0, 200, 200);
}
}
void Paint(Draw& w) override {
w.DrawRect(GetSize(), SColorPaper());
for(int i = 0; i < m_iml.GetCount(); i++) {
w.DrawImage(50, 80 + 20 * i, m_iml.Get(i));
w.DrawText(80, 80 + 20 * i, m_iml.GetId(i));
}
}
private:
Iml& m_iml;
};
GUI_APP_MAIN
{
MyApp(MyImages::Iml()).Sizeable().Run();
MyApp(MyImages::Iml()).Run();
}

View file

@ -5,54 +5,49 @@ using namespace Upp;
struct MyApp : public TopWindow {
Image img;
virtual void Paint(Draw& w);
virtual void LeftDown(Point p, dword keyflags);
typedef MyApp CLASSNAME;
MyApp();
};
MyApp::MyApp()
{
ImageBuffer ib(50, 50);
for(int y = 0; y < 50; y++) {
RGBA *l = ib[y];
for(int x = 0; x < 50; x++) {
if(y == 0 || y == 49 || x == 0 || x == 49)
*l++ = Black();
else {
l->a = 2 * (x + y);
l->r = 4 * x;
l->g = 4 * y;
l->b = 200;
l++;
MyApp() {
ImageBuffer ib(50, 50);
for(int y = 0; y < 50; y++) {
RGBA *l = ib[y];
for(int x = 0; x < 50; x++) {
if(y == 0 || y == 49 || x == 0 || x == 49) {
*l++ = Black();
}
else {
l->a = 2 * (x + y);
l->r = 4 * x;
l->g = 4 * y;
l->b = 200;
l++;
}
}
}
Premultiply(ib);
img = ib;
SetRect(0, 0, img.GetSize().cx + 50, img.GetSize().cy + 35);
}
Premultiply(ib);
img = ib;
}
void MyApp::Paint(Draw& w)
{
w.DrawRect(GetSize(), White);
w.DrawImage(10, 5, img);
w.DrawImage(40, 25, img);
}
void MyApp::LeftDown(Point p, dword keyflags)
{
ImageBuffer ib(img);
for(int y = 15; y < 35; y++) {
RGBA *l = ib[y];
for(int x = 15; x < 35; x++)
l[x] = 100 * Red();
void Paint(Draw& w) override {
w.DrawRect(GetSize(), White);
w.DrawImage(10, 5, img);
w.DrawImage(40, 25, img);
}
img = ib;
Refresh();
}
void LeftDown(Point p, dword keyflags) override {
ImageBuffer ib(img);
for(int y = 15; y < 35; y++) {
RGBA *l = ib[y];
for(int x = 15; x < 35; x++) {
l[x] = 100 * Red();
}
}
img = ib;
Refresh();
}
};
GUI_APP_MAIN
{
MyApp().Sizeable().Run();
MyApp().Run();
}

View file

@ -6,37 +6,32 @@ struct MyApp : public TopWindow {
Image img;
FileSel fs;
void Open();
virtual void Paint(Draw& w);
virtual void LeftDown(Point, dword) { Open(); }
typedef MyApp CLASSNAME;
MyApp();
};
MyApp::MyApp()
{
fs.Type("Image file", "*.bmp;*.png;*.tif;*.tiff;*.jpg;*.jpeg;*.gif");
Sizeable();
}
void MyApp::Paint(Draw& w)
{
w.DrawRect(GetSize(), White);
if(img)
w.DrawImage(0, 0, img);
else
w.DrawText(0, 0, "No image loaded!", Arial(30).Italic());
}
void MyApp::Open()
{
if(fs.ExecuteOpen("Choose the image file to open")) {
img = StreamRaster::LoadFileAny(~fs);
Refresh();
MyApp() {
fs.Type("Image file", "*.bmp;*.png;*.tif;*.tiff;*.jpg;*.jpeg;*.gif");
Sizeable();
}
}
void Paint(Draw& w) override {
w.DrawRect(GetSize(), White);
if(img) {
w.DrawImage(0, 0, img);
}
else {
w.DrawText(0, 0, "No image loaded!", Arial(30).Italic());
}
}
void LeftDown(Point, dword) override {
Open();
}
void Open() {
if(fs.ExecuteOpen("Choose the image file to open")) {
img = StreamRaster::LoadFileAny(~fs);
Refresh();
}
}
};
GUI_APP_MAIN
{

View file

@ -23,25 +23,20 @@ struct BallMaker : ImageMaker {
Color color;
int r;
virtual String Key() const;
virtual Image Make() const;
String Key() const override {
char h[sizeof(int) + 3];
*(int *)h = r;
h[sizeof(int)] = color.GetR();
h[sizeof(int) + 1] = color.GetG();
h[sizeof(int) + 2] = color.GetB();
return String(h, sizeof(int) + 3);
}
Image Make() const override {
return CreateBall(r, color);
}
};
String BallMaker::Key() const
{
char h[sizeof(int) + 3];
*(int *)h = r;
h[sizeof(int)] = color.GetR();
h[sizeof(int) + 1] = color.GetG();
h[sizeof(int) + 2] = color.GetB();
return String(h, sizeof(int) + 3);
}
Image BallMaker::Make() const
{
return CreateBall(r, color);
}
Image CreateBallCached(int r, Color color)
{
BallMaker m;
@ -53,7 +48,7 @@ Image CreateBallCached(int r, Color color)
struct MyApp : public TopWindow {
bool cached;
virtual void Paint(Draw& w) {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), White);
for(int y = 0; y < 300; y += 30)
for(int i = 10; i < 500; i += i / 3) {
@ -62,7 +57,7 @@ struct MyApp : public TopWindow {
}
}
virtual void LeftDown(Point, dword) {
void LeftDown(Point, dword) override {
cached = true;
Title("Now cached - try to resize the window to see the speed");
}

View file

@ -18,5 +18,5 @@ CONSOLE_APP_MAIN
Sql sql(sqlite3);
sql.Execute("select date('now')");
while(sql.Fetch())
Cout() << sql[0];
Cout() << sql[0] << '\n';
}

View file

@ -69,7 +69,7 @@ test upptst/Https with CLANG, release, debug
netasm, strawberry perl
make sure Scripts folder is on path
make sure Scripts folder is on windows path
from perl prompt run
@ -110,7 +110,7 @@ libcrypto_static.lib, libssl_static.lib -> bin/openssl/lib64/crypto.lib, ssl.lib
2020-09-03: 1.1.1g
2022-03-05: 1.1.1n
2023-09-28: 1.1.1w
------------------------------------------------------------------
plugin/jpg

View file

@ -1012,7 +1012,8 @@ static XmlNode sReadXmlNode(XmlParser& p, ParseXmlFilter *filter, dword style)
m.Shrink();
return m;
}
p.ReadText(); // skip empty text
if(p.ReadText().GetCount() == 0) // skip empty text
throw XmlError("Unexpected text");
return m;
}

View file

@ -224,9 +224,8 @@ Upp;]&]
[s0;l320;~~~32~32;C+75%- &]
[s0;l320;~~~32~32;%- [*C@(0.0.255)+75 struct][C+75 MyAppWindow ][C@(0.0.255)+75 :][C+75
TopWindow `{]&]
[s0;l320;~~~32~32;%- [C+75 ][*_C@(0.0.255)+75 virtual][*_C+75 ][*_C@(0.0.255)+75 void][*_C+75
Paint(Draw][*_C@(0.0.255)+75 `&][*_C+75 w) ][*_C@(0.0.255)+75 override][*_C+75
`{]&]
[s0;l320;~~~32~32;%- [C+75 ][*_C@(0.0.255)+75 void][*_C+75 Paint(Draw][*_C@(0.0.255)+75 `&
][*_C+75 w) ][*_C@(0.0.255)+75 override][*_C+75 `{]&]
[s0;l320;~~~32~32;%- [C+75 ][*_C+75 w][*_C@(0.0.255)+75 .][*_C+75 DrawRect(GetSize(),
SWhite());]&]
[s0;l320;~~~32~32;%- [C+75 ][*_C+75 w][*_C@(0.0.255)+75 .][*_C+75 DrawText(][*_C@3+75 2
@ -278,25 +277,24 @@ TopWindow `{]&]
[s0;l320;%- [C+75 Point p;]&]
[s0;l320;%- [C+75 String text;]&]
[s0;l320;C+75%- &]
[s0;l320;%- [*C+75 ][*_C@(0.0.255)+75 virtual][*_C+75 ][*_C@(0.0.255)+75 void][*_C+75
LeftDown(Point pos, ][*_C@(0.128.128)+75 dword][*_C+75 flags) ][*_C@(0.0.255)+75 overr
ide][*_C+75 `{]&]
[s0;l320;%- [*C+75 ][*_C@(0.0.255)+75 void][*_C+75 LeftDown(Point
pos, ][*_C@(0.128.128)+75 dword][*_C+75 flags) ][*_C@(0.0.255)+75 override][*_C+75
`{]&]
[s0;l320;%- [*C+75 ][*_C+75 p ][*_C@(0.0.255)+75 `=][*_C+75 pos;]&]
[s0;l320;%- [*C+75 ][*_C+75 Refresh();]&]
[s0;l320;%- [*C+75 ][*_C+75 `}]&]
[s0;l320;*C+75%- &]
[s0;l320;%- [*C+75 ][*_C@(0.0.255)+75 virtual][*_C+75 ][*_C@(0.0.255)+75 void][*_C+75
MouseMove(Point pos, ][*_C@(0.128.128)+75 dword][*_C+75 flags) ][*_C@(0.0.255)+75 over
ride][*_C+75 `{]&]
[s0;l320;%- [*C+75 ][*_C@(0.0.255)+75 void][*_C+75 MouseMove(Point
pos, ][*_C@(0.128.128)+75 dword][*_C+75 flags) ][*_C@(0.0.255)+75 override][*_C+75
`{]&]
[s0;l320;%- [*C+75 ][*_C+75 text ][*_C@(0.0.255)+75 `=][*_C+75 Format(][*_C@3+75 `"`[][*_C@(0.0.255)+75 %
d][*_C@3+75 :][*_C@(0.0.255)+75 %d][*_C@3+75 `]`"][*_C+75 , pos][*_C@(0.0.255)+75 .][*_C+75 x,
pos][*_C@(0.0.255)+75 .][*_C+75 y);]&]
[s0;l320;%- [*C+75 ][*_C+75 Refresh();]&]
[s0;l320;%- [*C+75 ][*_C+75 `}]&]
[s0;l320;C+75%- &]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 virtual][C+75 ][*C@(0.0.255)+75 void][C+75
Paint(Draw][C@(0.0.255)+75 `&][C+75 w) ][*C@(0.0.255)+75 override][C+75
`{]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 void][C+75 Paint(Draw][C@(0.0.255)+75 `&][C+75
w) ][*C@(0.0.255)+75 override][C+75 `{]&]
[s0;l320;%- [C+75 w][C@(0.0.255)+75 .][C+75 DrawRect(GetSize(),
SWhite);]&]
[s0;l320;%- [C+75 w][C@(0.0.255)+75 .][C+75 DrawText(p][C@(0.0.255)+75 .][C+75 x,
@ -502,9 +500,8 @@ MyApp?`"][C+75 ))]&]
[s0;l320;%- [C+75 Break();]&]
[s0;l320;%- [C+75 `}]&]
[s0;l320;C+75%- &]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 virtual][C+75 ][*C@(0.0.255)+75 void][C+75
RightDown(Point, ][C@(0.128.128)+75 dword][C+75 ) ][*C@(0.0.255)+75 override][C+75
`{]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 void][C+75 RightDown(Point, ][C@(0.128.128)+75 dword
][C+75 ) ][*C@(0.0.255)+75 override][C+75 `{]&]
[s0;l320;%- [C+75 ][*_C+75 MenuBar][*_C@(0.0.255)+75 `::][*_C+75 Execute(]&]
[s0;l320;%- [C+75 ][*_C@(0.0.255)+75 `[`=`]][*_C+75 (Bar][*_C@(0.0.255)+75 `&][*_C+75
bar) `{]&]
@ -550,9 +547,8 @@ MyApp?`"][C+75 ))]&]
[s0;l320;%- [C+75 Break();]&]
[s0;l320;%- [C+75 `}]&]
[s0;l320;C+75%- &]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 virtual][C+75 ][*C@(0.0.255)+75 void][C+75
RightDown(Point, ][C@(0.128.128)+75 dword][C+75 ) ][*C@(0.0.255)+75 override][C+75
`{]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 void][C+75 RightDown(Point, ][C@(0.128.128)+75 dword
][C+75 ) ][*C@(0.0.255)+75 override][C+75 `{]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 int][C+75 ][*_C+75 result][*C+75
][C@(0.0.255)+75 `=][C+75 ][C@(0.128.128)+75 Null][C+75 ;]&]
[s0;l320;%- [C+75 ][*_C+75 MenuBar menu][C+75 ;]&]
@ -1075,17 +1071,12 @@ to respond to platform setting of GUI font, U`+`+ provides functions
to zoom coordinates accordingly. Such zooming scale distances
by the ratio of current standard GUI font size to design font
size (which is based on old Win95 standard font size). Functions
Zx and Zy scale the horizontal or vertical distance. Logical
coordinate methods that end with Z (like LeftPos[* Z]) are then
scaling the values with these functions.&]
[* Zx] and [* Zy] scale the horizontal or vertical distance. Logical
coordinate methods that end with [* Z] (like [* LeftPosZ ]or [* TopPosZ])
are then scaling the values with these functions.&]
[s5; &]
[s7; GUI`_APP`_MAIN&]
[s7; `{&]
[s7; -|MyAppWindow app;&]
[s7; -|app.Run();&]
[s7; `}&]
[s0;l320;%- [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 CtrlLib][C@(0.0.255)+75 /
][C+75 CtrlLib][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s7;%- [@(128.0.255) #include][@0 ][@(0.0.255) <][@0 CtrlLib][@(0.0.255) /][@0 CtrlLib][@(0.0.255) .
][@0 h][@(0.0.255) >]&]
[s0;l320;C+75%- &]
[s0;l320;%- [*C@(0.0.255)+75 using][C+75 ][*C@(0.0.255)+75 namespace][C+75
Upp;]&]
@ -1555,8 +1546,7 @@ react to Enter and Esc keys and add specific visual appearance.&]
[* CtrlLayoutCancel], [* CtrlLayoutOKCancel ]etc. template functions
that both [^topic`:`/`/CtrlCore`/src`/Layout`_en`-us^ setup layout
and assign] Acceptors and Rejectors!&]
[s5; &]
[s7; [@(28.127.0) // main.cpp]&]
[s5; [/ main.cpp:]&]
[s0;l320;~~~>32;%- [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 CtrlLib][C@(0.0.255)+75 /
][C+75 CtrlLib][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320;~~~>32;C+75%- &]
@ -1585,8 +1575,8 @@ d][C@(0.0.255)+75 /][C+75 myapp][C@(0.0.255)+75 .][C+75 lay][C@(0.0.255)+75 >]&]
[s0;l320;~~~>32;%- [C+75 Exclamation(][C@3+75 `"Canceled`"][C+75 );]&]
[s0;l320;~~~>32;%- [C+75 `}]&]
[s0;l320;~~~>32;%- [C+75 `}]&]
[s7; &]
[s7; [@(28.127.0) // myapp.lay]&]
[s5;%- &]
[s5; [/ myapp.lay:]&]
[s0;l320;%- [*C@(0.0.255)+75 LAYOUT][C+75 (MyAppLayout, ][C@3+75 148][C+75 ,
][C@3+75 64][C+75 )]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 ITEM][C+75 (Upp][C@(0.0.255)+75 `::][C+75 EditDate,
@ -1601,7 +1591,7 @@ opPosZ(][C@3+75 32][C+75 , ][C@3+75 24][C+75 ))]&]
][C+75 )][C@(0.0.255)+75 .][C+75 LeftPosZ(][C@3+75 76][C+75 , ][C@3+75 64][C+75 )][C@(0.0.255)+75 .
][C+75 TopPosZ(][C@3+75 32][C+75 , ][C@3+75 24][C+75 ))]&]
[s0;l320;%- [*C@(0.0.255)+75 END][C@(0.0.255)+75 `_][*C@(0.0.255)+75 LAYOUT]&]
[s0; &]
[s5; &]
[s7;@(28.127.0) &]
[s7;
@@rawimage:697&461
@ -1623,18 +1613,16 @@ Ctrl `{]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 int][C+75 count ][C@(0.0.255)+75 `=][C+75
][C@3+75 0][C+75 ;]&]
[s0;l320;C+75%- &]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 virtual][C+75 ][*C@(0.0.255)+75 void][C+75
Paint(Draw][C@(0.0.255)+75 `&][C+75 w) ][*C@(0.0.255)+75 override][C+75
`{]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 void][C+75 Paint(Draw][C@(0.0.255)+75 `&][C+75
w) ][*C@(0.0.255)+75 override][C+75 `{]&]
[s0;l320;%- [C+75 w][C@(0.0.255)+75 .][C+75 DrawRect(GetSize(),
White());]&]
[s0;l320;%- [C+75 w][C@(0.0.255)+75 .][C+75 DrawText(][C@3+75 2][C+75 ,
][C@3+75 2][C+75 , AsString(count));]&]
[s0;l320;%- [C+75 `}]&]
[s0;l320;C+75%- &]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 virtual][C+75 ][*C@(0.0.255)+75 void][C+75
LeftDown(Point, ][C@(0.128.128)+75 dword][C+75 ) ][*C@(0.0.255)+75 override][C+75
`{]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 void][C+75 LeftDown(Point, ][C@(0.128.128)+75 dword][C+75 )
][*C@(0.0.255)+75 override][C+75 `{]&]
[s0;l320;%- [C+75 count][C@(0.0.255)+75 `+`+][C+75 ;]&]
[s0;l320;%- [C+75 Refresh();]&]
[s0;l320;%- [C+75 `}]&]
@ -1754,8 +1742,7 @@ create an application that will support multiple locales. For
this purpose, we will pick up one of the previous example in
which simple text is displayed inside the window, and we will
add translation support to it:&]
[s0; &]
[s7; [@(28.127.0) // main.cpp]&]
[s5; [/ main.cpp:]&]
[s7;%- [@(128.0.255) #include][@0 ][@(0.0.255) <][@0 CtrlLib][@(0.0.255) /][@0 CtrlLib][@(0.0.255) .
][@0 h][@(0.0.255) >]&]
[s0;l320;C+75%- &]
@ -1778,9 +1765,8 @@ My application`"][*_C@(0.128.128)$(255.255.192)+75 )][C+75 );]&]
etRect(][C@3+75 0][C+75 , ][C@3+75 0][C+75 , ][C@3+75 550][C+75 , ][C@3+75 100][C+75 );]&]
[s0;l320;%- [C+75 `}]&]
[s0;l320;%- [C+75 ]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 virtual][C+75 ][*C@(0.0.255)+75 void][C+75
Paint(Draw][C@(0.0.255)+75 `&][C+75 w) ][*C@(0.0.255)+75 override][C+75
`{]&]
[s0;l320;%- [C+75 ][*C@(0.0.255)+75 void][C+75 Paint(Draw][C@(0.0.255)+75 `&][C+75
w) ][*C@(0.0.255)+75 override][C+75 `{]&]
[s0;l320;%- [C+75 w][C@(0.0.255)+75 .][C+75 DrawRect(GetSize(),
SLtYellow);]&]
[s0;l320;%- [C+75 w][C@(0.0.255)+75 .][C+75 DrawText(][C@3+75 20][C+75 ,
@ -1828,12 +1814,12 @@ our users use.&]
[s5; The generated file with translated entries is located below.
For the purpose of this section we used electronic translator,
so for any errors we are sorry.&]
[s0; &]
[s5; [/ Gui23.t:]&]
[s7; [@(28.127.0) // Gui23.t]&]
[s0;l320;%- [C+75 #ifdef `_MSC`_VER]&]
[s0;l320;%- [C+75 #pragma setlocale(][C@3+75 `"C`"][C+75 )]&]
[s0;l320;%- [C+75 #endif]&]
[s0;l320;%- [/C+75 // main.cpp]&]
[s0;l320;%- [/C@4+75 // main.cpp]&]
[s0;l320;C+75%- &]
[s0;l320;%- [*C@(0.0.255)+75 T][C@(0.0.255)+75 `_][C+75 (][C@3+75 `"My application`"][C+75 )]&]
[s0;l320;%- [C@(0.128.128)+75 csCZ][C+75 (][C@3+75 `"Moje aplikace`"][C+75 )]&]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -81,7 +81,7 @@ String UnitEdit::AsText(double d, int unit)
String utxt = UnitText(unit);
if(unit == UNIT_POINT)
d = floor(10 * d + 0.5) / 10;
return AsString(d, unit == UNIT_DOT ? 0 : unit == UNIT_MM ? 1 : 2) + ' ' + utxt;
return FormatF(d, unit == UNIT_DOT ? 0 : unit == UNIT_MM ? 1 : 2) + ' ' + utxt;
}
String UnitEdit::DotAsText(int dot, int unit)

View file

@ -17,8 +17,6 @@ String HtmlFontStyle(Font f, Font base)
style << (f.IsBold() ? "font-weight:bold;" : "font-weight:normal;");
if(f.IsItalic() != base.IsItalic())
style << (f.IsItalic() ? "font-style:italic;" : "font-style:normal;");
if(f.IsUnderline() != base.IsUnderline())
style << (f.IsUnderline() ? "text-decoration:underline;" : "text-decoration:none;");
return style;
}
@ -33,18 +31,6 @@ String HtmlFontStyle(Font f)
style << Sprintf("font-size:%dpt;", f.GetHeight() * 72 / 600);
style << (f.IsBold() ? "font-weight:bold;" : "font-weight:normal;");
style << (f.IsItalic() ? "font-style:italic;" : "font-style:normal;");
if(f.IsUnderline() || f.IsStrikeout()) {
style << "text-decoration:";
if(f.IsUnderline())
style << "underline";
if(f.IsStrikeout()) {
if(f.IsUnderline())
style << ' ';
style << "line-through";
}
}
else
style << "text-decoration:none;";
return style;
}
@ -270,9 +256,13 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index<String>& css,
html << "<sub>";
endtag = "</sub>" + endtag;
}
if(part.format.IsUnderline()) {
html << "<u>";
endtag = "</u>" + endtag;
}
if(part.format.IsStrikeout()) {
html << "<strike>";
endtag = "</strike>" + endtag;
html << "<del>";
endtag = "</del>" + endtag;
}
if(part.format.capitals) {
html << "<span style=\"font-variant: small-caps;\">";

View file

@ -21,57 +21,65 @@ topic "SQL Tutorial";
[C2 $$20,20#70211524482531209251820423858195:class`-nested]
[b50;2 $$21,21#03324558446220344731010354752573:Par]
[2 $$0,0#00000000000000000000000000000000:Default]
[{_}%EN-US
[s2; SQL Tutorial&]
[s3; Table of contents&]
[s0; &]
[s0; [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#1^ 1. SqlSession,
[{_}
[s2;%% SQL Tutorial&]
[s3;%% Table of contents&]
[s0;%% &]
[s0;%% [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#1^ 1. SqlSession,
Sql, opening database connection]&]
[s0; [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#2^ 2. Using global
[s0;%% [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#2^ 2. Using global
main database, executing statements with parameters, getting
resultset info]&]
[s0; [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#3^ 3. Using SqlExp]&]
[s0; [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#4^ 4. Schema file]&]
[s0; [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#5^ 5. Using schema
[s0;%% [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#3^ 3. Using SqlExp]&]
[s0;%% [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#4^ 4. Schema file]&]
[s0;%% [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#5^ 5. Using schema
file to define SqlId constants]&]
[s0; [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#6^ 6. Using structures
[s0;%% [^topic`:`/`/Sql`/srcdoc`/tutorial`$en`-us`#6^ 6. Using structures
defined by schema files]&]
[s0; &]
[s3;:1: 1. SqlSession, Sql, opening database connection&]
[s5; SqlSession derived objects represent database connection. Each
SQL database (Sqlite3, Microsoft SQL, Oracle, MySQL, PostgreSQL)
[s0;%% &]
[s3;:1:%% 1. SqlSession, Sql, opening database connection&]
[s5;%% SqlSession derived objects represent database connection.
Each SQL database (Sqlite3, Microsoft SQL, Oracle, MySQL, PostgreSQL)
has its own session class derived from SqlSession. Sql class
is used to issue SQL statements and retrieve results:&]
[s7; &]
[s7; #include <Core/Core.h>&]
[s7; #include <plugin/sqlite3/Sqlite3.h>&]
[s7; &]
[s7; using namespace Upp;&]
[s7; &]
[s7; CONSOLE`_APP`_MAIN&]
[s7; `{&]
[s7; -|[* Sqlite3Session ]sqlite3;&]
[s7; -|if(!sqlite3.[* Open](ConfigFile(`"simple.db`"))) `{&]
[s7; -|-|Cout() << `"Can`'t create or open database file`\n`";&]
[s7; -|-|return;&]
[s7; -|`}&]
[s7; -|&]
[s7; #ifdef `_DEBUG&]
[s7; -|sqlite3.[* SetTrace();]&]
[s7; #endif&]
[s7; &]
[s7; -|[* Sql] sql(sqlite3);&]
[s7; -|sql.[* Execute](`"select date(`'now`')`");&]
[s7; -|while(sql.[* Fetch]())&]
[s7; -|-|Cout() << [* sql`[0`] ]<< `'`\n`' << ;&]
[s7; `}&]
[s7; &]
[s5; In this tutorial, we are using Sqlite3 database. The connection
[s5;%% &]
[s7;l320; [@(128.0.255) #include][@0 ][@(0.0.255) <][@0 Core][@(0.0.255) /][@0 Core][@(0.0.255) .][@0 h
][@(0.0.255) >]&]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 plugin][C@(0.0.255)+75 /][C+75 s
qlite3][C@(0.0.255)+75 /][C+75 Sqlite3][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320;C+75 &]
[s0;l320; [*C@(0.0.255)+75 using][C+75 ][*C@(0.0.255)+75 namespace][C+75
Upp;]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 CONSOLE`_APP`_MAIN]&]
[s0;l320; [C+75 `{]&]
[s0;l320; [C+75 ][*_C+75 Sqlite3Session][C+75 sqlite3;]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 if][C+75 (][C@(0.0.255)+75 !][C+75 sqlite3][C@(0.0.255)+75 .
][*_C+75 Open][C+75 (ConfigFile(][C@3+75 `"simple.db`"][C+75 ))) `{]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"Can`'t
create or open database file][C@(0.0.255)+75 `\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 ][*_C@(128.0.255)+75 return][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s0;l320; [C+75 ]&]
[s0;l320; [C@(128.0.255)+75 #ifdef][C+75 `_DEBUG]&]
[s0;l320; [C+75 sqlite3][C@(0.0.255)+75 .][*_C+75 SetTrace][C+75 ();]&]
[s0;l320; [C@(128.0.255)+75 #endif]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 ][*_C+75 Sql][C+75 sql(sqlite3);]&]
[s0;l320; [C+75 sql][C@(0.0.255)+75 .][*_C+75 Execute][C+75 (][C@3+75 `"select
date(`'now`')`"][C+75 );]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 while][C+75 (sql][C@(0.0.255)+75 .][*_C+75 Fetch][C+75 ())]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 ][*_C+75 sql][*_C@(0.0.255)+75 `[][*_C@3+75 0
][*_C@(0.0.255)+75 `]][C+75 ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `'][C@(0.0.255)+75 `\n][C@3+75 `'
][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s5;%% &]
[s5;%% In this tutorial, we are using Sqlite3 database. The connection
method varies with database; in this case it is done using [* Open
]statement.&]
[s5; [* SetTrace ]is useful in debug mode `- all issued SQL statements
[s5;%% [* SetTrace ]is useful in debug mode `- all issued SQL statements
and SQL errors are logged in standard U`+`+ log.&]
[s5; Each [* Sql] instance has to be associated to some SqlSession
[s5;%% Each [* Sql] instance has to be associated to some SqlSession
`- it is passed as constructor parameter (parameter`-less Sql
constructor uses global session, more on that in section 2.).
To execute SQL statements, use [* Execute]. If executed statement
@ -79,56 +87,75 @@ is Select, it may return a result set, which is retrieved using
[* Fetch]. Columns of result set are then accessed by Sql`::operator`[`]
using index of column (starts with 0). Values are returned as
Value type.&]
[s5; &]
[s3;:2: 2. Using global main database, executing statements with
[s5;%% &]
[s3;:2:%% 2. Using global main database, executing statements with
parameters, getting resultset info&]
[s5; Most applications need to work with just single database backend,
[s5;%% Most applications need to work with just single database backend,
therefore repeating SqlSession parameter in all Sql declarations
would be tedious.&]
[s5; To this end U`+`+ supports concept of `"main database`" which
[s5;%% To this end U`+`+ supports concept of `"main database`" which
is represented by [* SQL] variable. [* SQL] is of Sql type. When
any other Sql variable is created with default constructor (no
session parameter provided), it uses the same session as the
one the SQL is bound to. To assign session to global SQL, use
operator`=:&]
[s7; #include <Core/Core.h>&]
[s7; #include <plugin/sqlite3/Sqlite3.h>&]
[s7; &]
[s7; using namespace Upp;&]
[s7; &]
[s7; CONSOLE`_APP`_MAIN&]
[s7; `{&]
[s7; -|Sqlite3Session sqlite3;&]
[s7; -|if(!sqlite3.Open(ConfigFile(`"simple.db`"))) `{&]
[s7; -|-|Cout() << `"Can`'t create or open database file`\n`";&]
[s7; -|-|return;&]
[s7; -|`}&]
[s7; -|&]
[s7; #ifdef `_DEBUG&]
[s7; -|sqlite3.SetTrace();&]
[s7; #endif&]
[s7; &]
[s7; -|[* SQL `= ]sqlite3;&]
[s7; -|&]
[s7; -|[* SQL.]Execute(`"drop table TEST`");&]
[s7; -|SQL.ClearError();&]
[s7; -|SQL.Execute(`"create table TEST (A INTEGER, B TEXT)`");&]
[s7; &]
[s7; -|for(int i `= 0; i < 10; i`+`+)&]
[s7; -|-|SQL.[* Execute](`"insert into TEST(A, B) values ([* ?], [* ?])`",
i, AsString(3 `* i));&]
[s7; &]
[s7; -|Sql sql;&]
[s7; -|sql.Execute(`"select `* from TEST`");&]
[s7; -|for(int i `= 0; i < sql.[* GetColumns](); i`+`+)&]
[s7; -|-|Cout() << sql.[* GetColumnInfo](i).[* name ]<< `'`\n`';&]
[s7; -|while(sql.Fetch())&]
[s7; -|-|Cout() << sql`[0`] << `" `\`'`" << sql`[1`] << `"`\`'`\n`";&]
[s7; `}&]
[s7; &]
[s5; As global [* SQL] is regular Sql variable too, it can be used
[s5; &]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 Core][C@(0.0.255)+75 /][C+75 C
ore][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 plugin][C@(0.0.255)+75 /][C+75 s
qlite3][C@(0.0.255)+75 /][C+75 Sqlite3][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320;C+75 &]
[s0;l320; [*C@(0.0.255)+75 using][C+75 ][*C@(0.0.255)+75 namespace][C+75
Upp;]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 CONSOLE`_APP`_MAIN]&]
[s0;l320; [C+75 `{]&]
[s0;l320; [C+75 Sqlite3Session sqlite3;]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 if][C+75 (][C@(0.0.255)+75 !][C+75 sqlite3][C@(0.0.255)+75 .
][C+75 Open(ConfigFile(][C@3+75 `"simple.db`"][C+75 ))) `{]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"Can`'t
create or open database file][C@(0.0.255)+75 `\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 ][*_C@(128.0.255)+75 return][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s0;l320; [C+75 ]&]
[s0;l320; [C@(128.0.255)+75 #ifdef][C+75 `_DEBUG]&]
[s0;l320; [C+75 sqlite3][C@(0.0.255)+75 .][C+75 SetTrace();]&]
[s0;l320; [C@(128.0.255)+75 #endif]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 ][*_C+75 SQL][C+75 ][C@(0.0.255)+75 `=][C+75 sqlite3;]&]
[s0;l320; [C+75 ]&]
[s0;l320; [C+75 ][*_C+75 SQL][C@(0.0.255)+75 .][C+75 Execute(][C@3+75 `"drop
table TEST`"][C+75 );]&]
[s0;l320; [C+75 SQL][C@(0.0.255)+75 .][C+75 ClearError();]&]
[s0;l320; [C+75 SQL][C@(0.0.255)+75 .][C+75 Execute(][C@3+75 `"create
table TEST (A INTEGER, B TEXT)`"][C+75 );]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 ][*C@(0.0.255)+75 for][C+75 (][*C@(0.0.255)+75 int][C+75
i ][C@(0.0.255)+75 `=][C+75 ][C@3+75 0][C+75 ; i ][C@(0.0.255)+75 <][C+75
][C@3+75 10][C+75 ; i][C@(0.0.255)+75 `+`+][C+75 )]&]
[s0;l320; [C+75 SQL][C@(0.0.255)+75 .][*_C+75 Execute][C+75 (][C@3+75 `"insert
into TEST(A, B) values (?, ?)`"][C+75 , i, AsString(][C@3+75 3][C+75
][C@(0.0.255)+75 `*][C+75 i));]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 Sql sql;]&]
[s0;l320; [C+75 sql][C@(0.0.255)+75 .][C+75 Execute(][C@3+75 `"select
`* from TEST`"][C+75 );]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 for][C+75 (][*C@(0.0.255)+75 int][C+75
i ][C@(0.0.255)+75 `=][C+75 ][C@3+75 0][C+75 ; i ][C@(0.0.255)+75 <][C+75
sql][C@(0.0.255)+75 .][*_C+75 GetColumns][C+75 (); i][C@(0.0.255)+75 `+`+][C+75 )]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 sql][C@(0.0.255)+75 .][*_C+75 GetColu
mnInfo(i)][*_C@(0.0.255)+75 .][*_C+75 name][C+75 ][C@(0.0.255)+75 <<][C+75
][C@3+75 `'][C@(0.0.255)+75 `\n][C@3+75 `'][C+75 ;]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 while][C+75 (sql][C@(0.0.255)+75 .][C+75 Fetch())]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 sql][C@(0.0.255)+75 `[][C@3+75 0][C@(0.0.255)+75 `]
][C+75 ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `" ][C@(0.0.255)+75 `\`'][C@3+75 `"][C+75
][C@(0.0.255)+75 <<][C+75 sql][C@(0.0.255)+75 `[][C@3+75 1][C@(0.0.255)+75 `]][C+75
][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"][C@(0.0.255)+75 `\`'`\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s5;l320;%% &]
[s5;%% As global [* SQL] is regular Sql variable too, it can be used
to issue SQL statements.&]
[s5; [/ Warning: While it is possible to issue ][*/ select][/ statements
[s5;%% [/ Warning: While it is possible to issue ][*/ select][/ statements
through ][*/ SQL][/ , based on experience this is not recommended
`- way too often result set of ][*/ select][/ is canceled by issuing
some other command, e.g. in routine called as part of Fetch loop.
@ -136,246 +163,316 @@ One exception to this rule is using SQL`::operator% to fetch single
value like ][*C@5+75 String txt `= SQL % Select(TEXT).From(DOCTEMPLATE).Where(ID
`=`= id); ][/ (see further tutorial topics for detailed explanation
of this code).]&]
[s5; To get information about result set columns, you can use [* GetColumns
[s5;%% To get information about result set columns, you can use [* GetColumns
]to retrieve the number of columns and [* GetColumnInfo] to retrieve
information about columns `- returns [* SqlColumnInfo] reference
with information like name or type of column.&]
[s5; &]
[s3;:3: 3. Using SqlExp&]
[s5; U`+`+ contains an unique feature, `"SqlExp`". This is a mechanism
[s5;%% &]
[s3;:3:%% 3. Using SqlExp&]
[s5;%% U`+`+ contains an unique feature, `"SqlExp`". This is a mechanism
where you construct SQL statements as C`+`+ expressions (using
heavily overloaded operators).&]
[s5; There are three advantages to this approach:&]
[s5;l160;i150;O0; SQL statements are at least partially checked at
compile time&]
[s5;l160;i150;O0; As such statements are yet to be interpreted, it
is possible to hide some differences between DB engines&]
[s5;l160;i150;O0; It is much easier to create complex dynamic SQL
[s5;%% There are three advantages to this approach:&]
[s5;l160;i150;O0;%% SQL statements are at least partially checked
at compile time&]
[s5;l160;i150;O0;%% As such statements are yet to be interpreted,
it is possible to hide some differences between DB engines&]
[s5;l160;i150;O0;%% It is much easier to create complex dynamic SQL
statements&]
[s5; Database entity identifiers (like table or column names) can
[s5;%% Database entity identifiers (like table or column names) can
be defined as [* SqlId] type. For the complete lest of supported
SQL statements, see [^topic`:`/`/Sql`/src`/SqlExp`$en`-us^ SqlExp
in examples].&]
[s7; #include <Core/Core.h>&]
[s7; #include <plugin/sqlite3/Sqlite3.h>&]
[s7; &]
[s7; using namespace Upp;&]
[s7; &]
[s7; CONSOLE`_APP`_MAIN&]
[s7; `{&]
[s7; -|Sqlite3Session sqlite3;&]
[s7; -|if(!sqlite3.Open(ConfigFile(`"simple.db`"))) `{&]
[s7; -|-|Cout() << `"Can`'t create or open database file`\n`";&]
[s7; -|-|return;&]
[s7; -|`}&]
[s7; -|&]
[s7; #ifdef `_DEBUG&]
[s7; -|sqlite3.SetTrace();&]
[s7; #endif&]
[s7; &]
[s7; -|SQL `= sqlite3;&]
[s7; -|&]
[s7; -|SQL.Execute(`"drop table TEST`");&]
[s7; -|SQL.ClearError();&]
[s7; -|SQL.Execute(`"create table TEST (A INTEGER, B TEXT)`");&]
[s7; &]
[s7; -|[* SqlId] A(`"A`"), B(`"B`"), TEST(`"TEST`");&]
[s7; &]
[s7; -|for(int i `= 0; i < 10; i`+`+)&]
[s7; -|-|SQL [* `* Insert(TEST)(A, ]i[* )(B, ]AsString(3 `* i)[* );]&]
[s7; &]
[s7; -|Sql sql;&]
[s7; -|sql [* `* Select(A, B).From(TEST);]&]
[s7; -|while(sql.Fetch())&]
[s7; -|-|Cout() << [* sql`[A`]] << `" `\`'`" << [* sql`[B`]] << `"`\`'`\n`";&]
[s7; `}&]
[s7; &]
[s5; SqlId identifiers can be also used as parameter of Sql`::operator`[`]
[s5;%% &]
[s7;l320; [@(128.0.255) #include][@0 ][@(0.0.255) <][@0 Core][@(0.0.255) /][@0 Core][@(0.0.255) .][@0 h
][@(0.0.255) >]&]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 plugin][C@(0.0.255)+75 /][C+75 s
qlite3][C@(0.0.255)+75 /][C+75 Sqlite3][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320;C+75 &]
[s0;l320; [*C@(0.0.255)+75 using][C+75 ][*C@(0.0.255)+75 namespace][C+75
Upp;]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 CONSOLE`_APP`_MAIN]&]
[s0;l320; [C+75 `{]&]
[s0;l320; [C+75 Sqlite3Session sqlite3;]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 if][C+75 (][C@(0.0.255)+75 !][C+75 sqlite3][C@(0.0.255)+75 .
][C+75 Open(ConfigFile(][C@3+75 `"simple.db`"][C+75 ))) `{]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"Can`'t
create or open database file][C@(0.0.255)+75 `\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 ][*_C@(128.0.255)+75 return][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s0;l320; [C+75 ]&]
[s0;l320; [C@(128.0.255)+75 #ifdef][C+75 `_DEBUG]&]
[s0;l320; [C+75 sqlite3][C@(0.0.255)+75 .][C+75 SetTrace();]&]
[s0;l320; [C@(128.0.255)+75 #endif]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 SQL ][C@(0.0.255)+75 `=][C+75 sqlite3;]&]
[s0;l320; [C+75 ]&]
[s0;l320; [C+75 SQL][C@(0.0.255)+75 .][C+75 Execute(][C@3+75 `"drop table
TEST`"][C+75 );]&]
[s0;l320; [C+75 SQL][C@(0.0.255)+75 .][C+75 ClearError();]&]
[s0;l320; [C+75 SQL][C@(0.0.255)+75 .][C+75 Execute(][C@3+75 `"create
table TEST (A INTEGER, B TEXT)`"][C+75 );]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 ][*_C+75 SqlId][C+75 A(][C@3+75 `"A`"][C+75 ), B(][C@3+75 `"B`"][C+75 ),
TEST(][C@3+75 `"TEST`"][C+75 );]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 ][*C@(0.0.255)+75 for][C+75 (][*C@(0.0.255)+75 int][C+75
i ][C@(0.0.255)+75 `=][C+75 ][C@3+75 0][C+75 ; i ][C@(0.0.255)+75 <][C+75
][C@3+75 10][C+75 ; i][C@(0.0.255)+75 `+`+][C+75 )]&]
[s0;l320; [C+75 SQL ][*_C@(0.0.255)+75 `*][*_C+75 Insert(TEST)(A,
i)(B, AsString(][*_C@3+75 3][*_C+75 ][*_C@(0.0.255)+75 `*][*_C+75 i))][C+75 ;]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 Sql sql;]&]
[s0;l320; [C+75 sql ][*_C@(0.0.255)+75 `*][*_C+75 Select(A, B)][*_C@(0.0.255)+75 .][*_C+75 F
rom(TEST)][C+75 ;]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 while][C+75 (sql][C@(0.0.255)+75 .][C+75 Fetch())]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 ][*_C+75 sql][*_C@(0.0.255)+75 `[][*_C+75 A
][*_C@(0.0.255)+75 `]][C+75 ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `" ][C@(0.0.255)+75 `\`'][C@3+75 `"
][C+75 ][C@(0.0.255)+75 <<][C+75 ][*_C+75 sql][*_C@(0.0.255)+75 `[][*_C+75 B][*_C@(0.0.255)+75 `]
][C+75 ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"][C@(0.0.255)+75 `\`'`\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s5;l320; &]
[s5;%% SqlId identifiers can be also used as parameter of Sql`::operator`[`]
to retrieve particular columns of result`-set.&]
[s5; &]
[s3;:4: 4. Schema file&]
[s5; Schema files can be used to describe the database schema. Such
schema files can be used to upload the schema to the database,
[s5;%% &]
[s3;:4:%% 4. Schema file&]
[s5;%% Schema files can be used to describe the database schema.
Such schema files can be used to upload the schema to the database,
to defined SqlId constants and also to work with database records
as C`+`+ structures.&]
[s5; Following example demonstrates using schema file to create database
schema in SQL database server.&]
[s5; MyApp.sch:&]
[s7; &]
[s7; [* TABLE(TEST)]&]
[s7; [* -|INT (A)]&]
[s7; [* -|STRING (B, 200)]&]
[s7; [* END`_TABLE]&]
[s7; &]
[s5; MyApp.h&]
[s7; #ifndef `_MyApp`_h`_&]
[s7; #define `_MyApp`_h`_&]
[s7; &]
[s7; #include <Core/Core.h>&]
[s7; #include <plugin/sqlite3/Sqlite3.h>&]
[s7; &]
[s7; using namespace Upp;&]
[s7; &]
[s7; [* #define SCHEMADIALECT <plugin/sqlite3/Sqlite3Schema.h>]&]
[s7; [* #define MODEL <Sql04/MyApp.sch>]&]
[s7; [* #include `"Sql/sch`_header.h`"]&]
[s7; &]
[s7; #endif&]
[s7;* &]
[s5; main.cpp&]
[s7; #include `"MyApp.h`"&]
[s7; &]
[s7; [* #include <Sql/sch`_schema.h>]&]
[s7; [* #include <Sql/sch`_source.h>]&]
[s7; &]
[s7; CONSOLE`_APP`_MAIN&]
[s7; `{&]
[s7; -|Sqlite3Session sqlite3;&]
[s7; -|if(!sqlite3.Open(ConfigFile(`"simple.db`"))) `{&]
[s7; -|-|Cout() << `"Can`'t create or open database file`\n`";&]
[s7; -|-|return;&]
[s7; -|`}&]
[s7; -|&]
[s7; #ifdef `_DEBUG&]
[s7; -|sqlite3.SetTrace();&]
[s7; #endif&]
[s7; &]
[s7; -|SQL `= sqlite3;&]
[s7; &]
[s7; [* -|SqlSchema sch(SQLITE3);]&]
[s7; [* -|All`_Tables(sch);]&]
[s7; [* -|SqlPerformScript(sch.Upgrade());]&]
[s7; [* -|SqlPerformScript(sch.Attributes());]&]
[s7; [* -|SQL.ClearError();]&]
[s7; &]
[s7; -|SqlId A(`"A`"), B(`"B`"), TEST(`"TEST`");&]
[s7; &]
[s7; -|for(int i `= 0; i < 10; i`+`+)&]
[s7; -|-|SQL `* Insert(TEST)(A, i)(B, AsString(3 `* i));&]
[s7; &]
[s7; -|Sql sql;&]
[s7; -|sql `* Select(A, B).From(TEST);&]
[s7; -|while(sql.Fetch())&]
[s7; -|-|Cout() << sql`[A`] << `" `\`'`" << sql`[B`] << `"`\`'`\n`";&]
[s7; `}&]
[s7;* &]
[s5; &]
[s3;:5: 5. Using schema file to define SqlId constants&]
[s5; As names of columns are present in the database schema, it is
natural to recycle them to create SqlId constants.&]
[s5; However, due to C`+`+ one definition rule (.sch files are interpreted
as C`+`+ sources, using changing set of macros), you have to
mark identifiers using underscore:&]
[s5; MyApp.sch:&]
[s7; [* TABLE`_](TEST)&]
[s7; -|[* INT`_] (A)&]
[s7; -|[* STRING`_] (B, 200)&]
[s7; END`_TABLE&]
[s7; &]
[s7; TABLE`_(TEST2)&]
[s7; -|[* INT] (A)&]
[s7; -|[* STRING] (B, 200)&]
[s7; END`_TABLE&]
[s5; &]
[s5; MyApp.h:&]
[s7; #ifndef `_MyApp`_h`_&]
[s7; #define `_MyApp`_h`_&]
[s7; &]
[s7; #include <Core/Core.h>&]
[s7; #include <plugin/sqlite3/Sqlite3.h>&]
[s7; &]
[s7; using namespace Upp;&]
[s7; &]
[s7; #define SCHEMADIALECT <plugin/sqlite3/Sqlite3Schema.h>&]
[s7; #define MODEL <Sql05/MyApp.sch>&]
[s7; #include `"Sql/sch`_header.h`"&]
[s7; &]
[s7; #endif&]
[s7; &]
[s5; main.cpp:&]
[s7; #include `"MyApp.h`"&]
[s7; &]
[s7; #include <Sql/sch`_schema.h>&]
[s7; #include <Sql/sch`_source.h>&]
[s7; &]
[s7; CONSOLE`_APP`_MAIN&]
[s7; `{&]
[s7; -|Sqlite3Session sqlite3;&]
[s7; -|if(!sqlite3.Open(ConfigFile(`"simple.db`"))) `{&]
[s7; -|-|Cout() << `"Can`'t create or open database file`\n`";&]
[s7; -|-|return;&]
[s7; -|`}&]
[s7; -|&]
[s7; #ifdef `_DEBUG&]
[s7; -|sqlite3.SetTrace();&]
[s7; #endif&]
[s7; &]
[s7; -|SQL `= sqlite3;&]
[s7; &]
[s7; -|SqlSchema sch(SQLITE3);&]
[s7; -|All`_Tables(sch);&]
[s7; -|SqlPerformScript(sch.Upgrade());&]
[s7; -|SqlPerformScript(sch.Attributes());&]
[s7; -|SQL.ClearError();&]
[s7; &]
[s7; -|for(int i `= 0; i < 10; i`+`+)&]
[s7; -|-|SQL `* Insert(TEST)(A, i)(B, AsString(3 `* i));&]
[s7; &]
[s7; -|Sql sql;&]
[s7; -|sql `* Select(A, B).From(TEST);&]
[s7; -|while(sql.Fetch())&]
[s7; -|-|Cout() << sql`[A`] << `" `\`'`" << sql`[B`] << `"`\`'`\n`";&]
[s7; `}&]
[s7; &]
[s5; &]
[s3;:6: 6. Using structures defined by schema files&]
[s5; Schema files also define structures that can be used to fetch,
[s5;%% Following example demonstrates using schema file to create
database schema in SQL database server.&]
[s5;%% [/ MyApp.sch:]&]
[s5;%% &]
[s0;l320; [*C@(0.0.255)+75 TABLE][C+75 (TEST)]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 INT][C+75 (A)]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 STRING][C+75 (B, ][C@3+75 200][C+75 )]&]
[s0;l320; [*C@(0.0.255)+75 END][C@(0.0.255)+75 `_][*C@(0.0.255)+75 TABLE]&]
[s5;%% &]
[s5;%% [/ MyApp.h:]&]
[s5;/%% &]
[s0;l320; [C@(128.0.255)+75 #ifndef][C+75 `_MyApp`_h`_]&]
[s0;l320; [C@(128.0.255)+75 #define][C+75 `_MyApp`_h`_]&]
[s0;l320;C+75 &]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 Core][C@(0.0.255)+75 /][C+75 C
ore][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 plugin][C@(0.0.255)+75 /][C+75 s
qlite3][C@(0.0.255)+75 /][C+75 Sqlite3][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320;C+75 &]
[s0;l320; [*C@(0.0.255)+75 using][C+75 ][*C@(0.0.255)+75 namespace][C+75
Upp;]&]
[s0;l320;C+75 &]
[s0;l320; [*_C@(128.0.255)+75 #define][*_C+75 SCHEMADIALECT ][*_C@(0.0.255)+75 <][*_C+75 plu
gin][*_C@(0.0.255)+75 /][*_C+75 sqlite3][*_C@(0.0.255)+75 /][*_C+75 Sqlite3Schema][*_C@(0.0.255)+75 .
][*_C+75 h][*_C@(0.0.255)+75 >]&]
[s0;l320; [*_C@(128.0.255)+75 #define][*_C+75 MODEL ][*_C@(0.0.255)+75 <][*_C+75 Sql04][*_C@(0.0.255)+75 /
][*_C+75 MyApp][*_C@(0.0.255)+75 .][*_C+75 sch][*_C@(0.0.255)+75 >]&]
[s0;l320; [*_C@(128.0.255)+75 #include][*_C+75 ][*_C@3+75 `"Sql/sch`_header.h`"]&]
[s0;l320;C+75 &]
[s0;l320; [C@(128.0.255)+75 #endif]&]
[s5;%% &]
[s5;%% [/ main.cpp:]&]
[s5;/%% &]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@3+75 `"MyApp.h`"]&]
[s0;l320;C+75 &]
[s0;l320; [*_C@(128.0.255)+75 #include][*_C+75 ][*_C@(0.0.255)+75 <][*_C+75 Sql][*_C@(0.0.255)+75 /
][*_C+75 sch`_schema][*_C@(0.0.255)+75 .][*_C+75 h][*_C@(0.0.255)+75 >]&]
[s0;l320; [*_C@(128.0.255)+75 #include][*_C+75 ][*_C@(0.0.255)+75 <][*_C+75 Sql][*_C@(0.0.255)+75 /
][*_C+75 sch`_source][*_C@(0.0.255)+75 .][*_C+75 h][*_C@(0.0.255)+75 >]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 CONSOLE`_APP`_MAIN]&]
[s0;l320; [C+75 `{]&]
[s0;l320; [C+75 Sqlite3Session sqlite3;]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 if][C+75 (][C@(0.0.255)+75 !][C+75 sqlite3][C@(0.0.255)+75 .
][C+75 Open(ConfigFile(][C@3+75 `"simple.db`"][C+75 ))) `{]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"Can`'t
create or open database file][C@(0.0.255)+75 `\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 ][*_C@(128.0.255)+75 return][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s0;l320; [C+75 ]&]
[s0;l320; [C@(128.0.255)+75 #ifdef][C+75 `_DEBUG]&]
[s0;l320; [C+75 sqlite3][C@(0.0.255)+75 .][C+75 SetTrace();]&]
[s0;l320; [C@(128.0.255)+75 #endif]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 SQL ][C@(0.0.255)+75 `=][C+75 sqlite3;]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 ][*_C+75 SqlSchema sch(SQLITE3);]&]
[s0;l320; [C+75 ][*_C+75 All`_Tables(sch);]&]
[s0;l320; [C+75 ][*_C+75 SqlPerformScript(sch][*_C@(0.0.255)+75 .][*_C+75 Upgrade());]&]
[s0;l320; [C+75 ][*_C+75 SqlPerformScript(sch][*_C@(0.0.255)+75 .][*_C+75 Attributes());]&]
[s0;l320; [C+75 ][*_C+75 SQL][*_C@(0.0.255)+75 .][*_C+75 ClearError();]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 SqlId A(][C@3+75 `"A`"][C+75 ), B(][C@3+75 `"B`"][C+75 ),
TEST(][C@3+75 `"TEST`"][C+75 );]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 ][*C@(0.0.255)+75 for][C+75 (][*C@(0.0.255)+75 int][C+75
i ][C@(0.0.255)+75 `=][C+75 ][C@3+75 0][C+75 ; i ][C@(0.0.255)+75 <][C+75
][C@3+75 10][C+75 ; i][C@(0.0.255)+75 `+`+][C+75 )]&]
[s0;l320; [C+75 SQL ][C@(0.0.255)+75 `*][C+75 Insert(TEST)(A,
i)(B, AsString(][C@3+75 3][C+75 ][C@(0.0.255)+75 `*][C+75 i));]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 Sql sql;]&]
[s0;l320; [C+75 sql ][C@(0.0.255)+75 `*][C+75 Select(A, B)][C@(0.0.255)+75 .][C+75 From(TE
ST);]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 while][C+75 (sql][C@(0.0.255)+75 .][C+75 Fetch())]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 sql][C@(0.0.255)+75 `[][C+75 A][C@(0.0.255)+75 `]
][C+75 ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `" ][C@(0.0.255)+75 `\`'][C@3+75 `"][C+75
][C@(0.0.255)+75 <<][C+75 sql][C@(0.0.255)+75 `[][C+75 B][C@(0.0.255)+75 `]][C+75
][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"][C@(0.0.255)+75 `\`'`\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s5;%% &]
[s3;:5:%% 5. Using schema file to define SqlId constants&]
[s5;%% As names of columns are present in the database schema, it
is natural to recycle them to create SqlId constants.&]
[s5;%% However, due to C`+`+ one definition rule (.sch files are
interpreted as C`+`+ sources, using changing set of macros),
you have to mark identifiers using underscore:&]
[s5;%% [/ MyApp.sch:]&]
[s5;/%% &]
[s0;l320; [*C@(0.0.255)+75 TABLE][C@(0.0.255)+75 `_][C+75 (TEST)]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 INT][C@(0.0.255)+75 `_][C+75
(A)]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 STRING][C@(0.0.255)+75 `_][C+75
(B, ][C@3+75 200][C+75 )]&]
[s0;l320; [*C@(0.0.255)+75 END][C@(0.0.255)+75 `_][*C@(0.0.255)+75 TABLE]&]
[s0;l320;C+75 &]
[s0;l320; [*C@(0.0.255)+75 TABLE][C@(0.0.255)+75 `_][C+75 (TEST2)]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 INT][C+75 (A)]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 STRING][C+75 (B, ][C@3+75 200][C+75 )]&]
[s0;l320; [*C@(0.0.255)+75 END][C@(0.0.255)+75 `_][*C@(0.0.255)+75 TABLE]&]
[s5;%% &]
[s5;%% MyApp.h:&]
[s5;%% &]
[s0;l320; [C@(128.0.255)+75 #ifndef][C+75 `_MyApp`_h`_]&]
[s0;l320; [C@(128.0.255)+75 #define][C+75 `_MyApp`_h`_]&]
[s0;l320;C+75 &]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 Core][C@(0.0.255)+75 /][C+75 C
ore][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 plugin][C@(0.0.255)+75 /][C+75 s
qlite3][C@(0.0.255)+75 /][C+75 Sqlite3][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320;C+75 &]
[s0;l320; [*C@(0.0.255)+75 using][C+75 ][*C@(0.0.255)+75 namespace][C+75
Upp;]&]
[s0;l320;C+75 &]
[s0;l320; [C@(128.0.255)+75 #define][C+75 SCHEMADIALECT ][C@(0.0.255)+75 <][C+75 plugin][C@(0.0.255)+75 /
][C+75 sqlite3][C@(0.0.255)+75 /][C+75 Sqlite3Schema][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >
]&]
[s0;l320; [C@(128.0.255)+75 #define][C+75 MODEL ][C@(0.0.255)+75 <][C+75 Sql05][C@(0.0.255)+75 /
][C+75 MyApp][C@(0.0.255)+75 .][C+75 sch][C@(0.0.255)+75 >]&]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@3+75 `"Sql/sch`_header.h`"]&]
[s0;l320;C+75 &]
[s0;l320; [C@(128.0.255)+75 #endif]&]
[s5;%% &]
[s5;%% main.cpp:&]
[s5;%% &]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@3+75 `"MyApp.h`"]&]
[s0;l320;C+75 &]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 Sql][C@(0.0.255)+75 /][C+75 s
ch`_schema][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 Sql][C@(0.0.255)+75 /][C+75 s
ch`_source][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 CONSOLE`_APP`_MAIN]&]
[s0;l320; [C+75 `{]&]
[s0;l320; [C+75 Sqlite3Session sqlite3;]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 if][C+75 (][C@(0.0.255)+75 !][C+75 sqlite3][C@(0.0.255)+75 .
][C+75 Open(ConfigFile(][C@3+75 `"simple.db`"][C+75 ))) `{]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"Can`'t
create or open database file][C@(0.0.255)+75 `\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 ][*_C@(128.0.255)+75 return][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s0;l320; [C+75 ]&]
[s0;l320; [C@(128.0.255)+75 #ifdef][C+75 `_DEBUG]&]
[s0;l320; [C+75 sqlite3][C@(0.0.255)+75 .][C+75 SetTrace();]&]
[s0;l320; [C@(128.0.255)+75 #endif]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 SQL ][C@(0.0.255)+75 `=][C+75 sqlite3;]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 SqlSchema sch(SQLITE3);]&]
[s0;l320; [C+75 All`_Tables(sch);]&]
[s0;l320; [C+75 SqlPerformScript(sch][C@(0.0.255)+75 .][C+75 Upgrade());]&]
[s0;l320; [C+75 SqlPerformScript(sch][C@(0.0.255)+75 .][C+75 Attributes());]&]
[s0;l320; [C+75 SQL][C@(0.0.255)+75 .][C+75 ClearError();]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 ][*C@(0.0.255)+75 for][C+75 (][*C@(0.0.255)+75 int][C+75
i ][C@(0.0.255)+75 `=][C+75 ][C@3+75 0][C+75 ; i ][C@(0.0.255)+75 <][C+75
][C@3+75 10][C+75 ; i][C@(0.0.255)+75 `+`+][C+75 )]&]
[s0;l320; [C+75 SQL ][C@(0.0.255)+75 `*][C+75 Insert(TEST)(A,
i)(B, AsString(][C@3+75 3][C+75 ][C@(0.0.255)+75 `*][C+75 i));]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 Sql sql;]&]
[s0;l320; [C+75 sql ][C@(0.0.255)+75 `*][C+75 Select(A, B)][C@(0.0.255)+75 .][C+75 From(TE
ST);]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 while][C+75 (sql][C@(0.0.255)+75 .][C+75 Fetch())]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 sql][C@(0.0.255)+75 `[][C+75 A][C@(0.0.255)+75 `]
][C+75 ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `" ][C@(0.0.255)+75 `\`'][C@3+75 `"][C+75
][C@(0.0.255)+75 <<][C+75 sql][C@(0.0.255)+75 `[][C+75 B][C@(0.0.255)+75 `]][C+75
][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"][C@(0.0.255)+75 `\`'`\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s5;%% &]
[s3;:6:%% 6. Using structures defined by schema files&]
[s5;%% Schema files also define structures that can be used to fetch,
insert or update database records. Names of such structures are
identical to the names of tables, with [* S`_] prefix:&]
[s7; #include `"MyApp.h`"&]
[s7; &]
[s7; #include <Sql/sch`_schema.h>&]
[s7; #include <Sql/sch`_source.h>&]
[s7; &]
[s7; CONSOLE`_APP`_MAIN&]
[s7; `{&]
[s7; -|Sqlite3Session sqlite3;&]
[s7; -|if(!sqlite3.Open(ConfigFile(`"simple.db`"))) `{&]
[s7; -|-|Cout() << `"Can`'t create or open database file`\n`";&]
[s7; -|-|return;&]
[s7; -|`}&]
[s7; -|&]
[s7; #ifdef `_DEBUG&]
[s7; -|sqlite3.SetTrace();&]
[s7; #endif&]
[s7; &]
[s7; -|SQL `= sqlite3;&]
[s7; &]
[s7; -|SqlSchema sch(SQLITE3);&]
[s7; -|All`_Tables(sch);&]
[s7; -|SqlPerformScript(sch.Upgrade());&]
[s7; -|SqlPerformScript(sch.Attributes());&]
[s7; -|SQL.ClearError();&]
[s7; &]
[s7; -|[* S`_TEST] x;&]
[s7; -|for(int i `= 0; i < 10; i`+`+) `{&]
[s7; -|-|[* x.A `= i;]&]
[s7; -|-|[* x.B `= AsString(3 `* i);]&]
[s7; -|-|[* SQL `* Insert(x);]&]
[s7; -|`}&]
[s7; &]
[s7; -|Sql sql;&]
[s7; -|sql `* Select([* x]).From(TEST);&]
[s7; -|while(sql.Fetch([* x]))&]
[s7; -|-|Cout() << [* x.A] << `" `\`'`" << [* x.B] << `"`\`'`\n`";&]
[s7; `}&]
[s5; &]
[s3; Recommended tutorials:&]
[s5; If you want to learn more, we have several tutorials that you
can find useful:&]
[s5;l160;i150;O0;~~~0; [^topic`:`/`/Skylark`/srcdoc`/Tutorial`_en`-us^ Skylark]
[s5;%% &]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@3+75 `"MyApp.h`"]&]
[s0;l320;C+75 &]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 Sql][C@(0.0.255)+75 /][C+75 s
ch`_schema][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320; [C@(128.0.255)+75 #include][C+75 ][C@(0.0.255)+75 <][C+75 Sql][C@(0.0.255)+75 /][C+75 s
ch`_source][C@(0.0.255)+75 .][C+75 h][C@(0.0.255)+75 >]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 CONSOLE`_APP`_MAIN]&]
[s0;l320; [C+75 `{]&]
[s0;l320; [C+75 Sqlite3Session sqlite3;]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 if][C+75 (][C@(0.0.255)+75 !][C+75 sqlite3][C@(0.0.255)+75 .
][C+75 Open(ConfigFile(][C@3+75 `"simple.db`"][C+75 ))) `{]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"Can`'t
create or open database file][C@(0.0.255)+75 `\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 ][*_C@(128.0.255)+75 return][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s0;l320; [C+75 ]&]
[s0;l320; [C@(128.0.255)+75 #ifdef][C+75 `_DEBUG]&]
[s0;l320; [C+75 sqlite3][C@(0.0.255)+75 .][C+75 SetTrace();]&]
[s0;l320; [C@(128.0.255)+75 #endif]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 SQL ][C@(0.0.255)+75 `=][C+75 sqlite3;]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 SqlSchema sch(SQLITE3);]&]
[s0;l320; [C+75 All`_Tables(sch);]&]
[s0;l320; [C+75 SqlPerformScript(sch][C@(0.0.255)+75 .][C+75 Upgrade());]&]
[s0;l320; [C+75 SqlPerformScript(sch][C@(0.0.255)+75 .][C+75 Attributes());]&]
[s0;l320; [C+75 SQL][C@(0.0.255)+75 .][C+75 ClearError();]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 ][*_C+75 S`_TEST x;]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 for][C+75 (][*C@(0.0.255)+75 int][C+75
i ][C@(0.0.255)+75 `=][C+75 ][C@3+75 0][C+75 ; i ][C@(0.0.255)+75 <][C+75
][C@3+75 10][C+75 ; i][C@(0.0.255)+75 `+`+][C+75 ) `{]&]
[s0;l320; [C+75 ][*_C+75 x][*_C@(0.0.255)+75 .][*_C+75 A ][*_C@(0.0.255)+75 `=][*_C+75
i;]&]
[s0;l320; [C+75 ][*_C+75 x][*_C@(0.0.255)+75 .][*_C+75 B ][*_C@(0.0.255)+75 `=][*_C+75
AsString(][*_C@3+75 3][*_C+75 ][*_C@(0.0.255)+75 `*][*_C+75 i);]&]
[s0;l320; [C+75 ][*_C+75 SQL ][*_C@(0.0.255)+75 `*][*_C+75 Insert(x);]&]
[s0;l320; [C+75 `}]&]
[s0;l320;C+75 &]
[s0;l320; [C+75 Sql sql;]&]
[s0;l320; [C+75 sql ][C@(0.0.255)+75 `*][C+75 Select(][*_C+75 x][C+75 )][C@(0.0.255)+75 .][C+75 F
rom(TEST);]&]
[s0;l320; [C+75 ][*C@(0.0.255)+75 while][C+75 (sql][C@(0.0.255)+75 .][C+75 Fetch(][*_C+75 x][C+75 )
)]&]
[s0;l320; [C+75 Cout() ][C@(0.0.255)+75 <<][C+75 ][*_C+75 x][*_C@(0.0.255)+75 .][*_C+75 A
][C+75 ][C@(0.0.255)+75 <<][C+75 ][C@3+75 `" ][C@(0.0.255)+75 `\`'][C@3+75 `"][C+75
][C@(0.0.255)+75 <<][C+75 ][*_C+75 x][*_C@(0.0.255)+75 .][*_C+75 B][C+75
][C@(0.0.255)+75 <<][C+75 ][C@3+75 `"][C@(0.0.255)+75 `\`'`\n][C@3+75 `"][C+75 ;]&]
[s0;l320; [C+75 `}]&]
[s5;l320;%% &]
[s3;%% Recommended tutorials:&]
[s5;%% If you want to learn more, we have several tutorials that
you can find useful:&]
[s5;l160;i150;O0;~~~0;%% [^topic`:`/`/Skylark`/srcdoc`/Tutorial`_en`-us^ Skylark]
`- now you know everything about databases `- why not to use
your knowledge to become web development star?&]
[s5;l160;i150;O0;~~~0; [^topic`:`/`/Core`/srcdoc`/Tutorial`_en`-us^ U`+`+
[s5;l160;i150;O0;~~~0;%% [^topic`:`/`/Core`/srcdoc`/Tutorial`_en`-us^ U`+`+
Core value types] `- still not very confident with U`+`+. In
this tutorial you will learn basics.]]

View file

@ -360,9 +360,11 @@ Vector<String> CppBuilder::CustomStep(const String& pf, const String& package_,
}
}
}
else
if(p.Id("exclude")) {
ExtExclude(p, packageFolder, out, flags);
}
else
if(p.Id("include_path")) {
bool apply = CheckImportCondition(p, flags);
Vector<String> e = ReadPatterns(p);
@ -376,10 +378,12 @@ Vector<String> CppBuilder::CustomStep(const String& pf, const String& package_,
}
}
}
else
if(p.Id("exclude_path")) {
ExtExclude(p, packageFolder, include_path, flags);
}
if(p.Id("includes")) {
else {
p.PassId("includes");
bool apply = CheckImportCondition(p, flags);
Vector<String> e = ReadPatterns(p);
if(apply) {
@ -392,7 +396,7 @@ Vector<String> CppBuilder::CustomStep(const String& pf, const String& package_,
}
}
}
catch(CParser::Error) {
catch(CParser::Error e) {
PutConsole("Invalid .ext file");
error = true;
return Vector<String>();

View file

@ -259,6 +259,8 @@ void Ide::GoToError(const ListLineInfo& f, bool error)
return;
String file = NormalizePath(f.file);
DoEditAsText(file);
if(designer)
FlushFile();
EditFile(file);
int lp = max(f.linepos - 1, 0);
int l = f.lineno - 1;
@ -267,7 +269,7 @@ void Ide::GoToError(const ListLineInfo& f, bool error)
l = editor.GetLineNo(l);
else {
String ln = TrimLeft(f.line);
if(ln.GetCount())
if(ln.GetCount() && l >= 0 && l < editor.GetLineCount())
for(int i = 0; i < 200; i++) {
if(l - i >= 0 && TrimLeft(editor.GetUtf8Line(l - i)) == ln) {
l = l - i;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -27,7 +27,7 @@ its directory.&]
[s5; The archive contains CLANG based Win32 toolchain and also SDL
2, OpenSSL, MySql and PostgreSQL client libraries. TheIDE will
also setup Microsoft C`+`+ compiler if it finds one.&]
[s5; U`+`+ minimum requirement is Windows 7 64 with latest patches
[s5; U`+`+ minimum requirement is Windows 10 64 with latest patches
for theide to run and Windows 7 64 or 32 with latest patches
for compiled applications.&]
[s5; ]]

View file

@ -1,8 +1,8 @@
TITLE("Ultimate++ Windows Installation")
COMPRESSED
120,156,133,84,93,111,219,70,16,252,43,7,200,45,90,135,86,110,239,251,196,151,20,118,208,6,112,146,182,110,208,7,65,169,104,234,100,93,75,147,12,121,170,226,20,205,111,239,28,37,39,233,67,81,9,162,36,240,102,119,102,118,150,203,70,56,87,70,203,85,89,145,45,95,251,242,227,199,143,115,239,69,41,216,217,25,21,124,70,92,73,18,68,138,115,37,44,105,207,189,118,228,184,180,74,104,203,245,162,175,134,234,126,181,172,156,44,207,127,54,64,137,66,207,36,73,226,100,132,194,41,46,185,80,36,52,57,167,200,106,39,189,49,139,186,234,83,236,218,213,242,7,85,222,102,168,2,82,2,201,173,51,138,128,83,90,72,171,21,240,74,17,225,55,105,107,172,93,164,152,154,176,90,222,146,177,101,165,68,121,153,153,170,194,204,192,80,88,64,149,80,70,73,39,36,57,33,140,151,202,43,80,39,177,136,41,128,232,45,48,25,215,239,50,80,163,165,210,138,36,135,62,171,37,14,90,124,43,238,73,160,175,227,90,163,101,120,159,86,203,201,170,236,82,198,25,
52,20,86,231,211,78,57,146,214,9,37,140,0,5,110,33,53,247,215,139,77,24,107,224,164,160,50,129,84,121,249,76,151,4,176,45,236,76,112,207,133,177,30,13,65,23,146,165,247,36,29,26,42,210,156,228,162,238,54,89,166,208,92,78,29,29,134,97,80,121,114,69,27,2,97,33,29,90,90,146,18,87,173,156,93,140,33,143,35,117,195,106,217,239,206,159,125,195,231,124,46,180,254,54,23,240,40,224,164,146,82,25,175,136,75,52,66,21,149,61,51,28,35,37,45,220,226,182,26,209,53,169,236,238,228,44,113,192,96,190,116,90,162,185,193,5,179,133,68,9,119,132,87,78,74,199,23,117,83,141,227,23,22,157,103,153,68,5,209,204,102,103,181,20,202,103,123,164,128,197,194,104,79,240,88,27,197,197,98,8,239,246,113,8,247,161,133,201,17,17,41,31,71,116,138,35,200,28,227,40,10,18,8,164,54,134,103,199,52,18,33,164,134,229,156,156,2,35,188,49,230,116,74,228,237,103,13,178,32,57,243,66,73,48,241,74,193,1,20,32,79,68,220,225,13,101,
240,101,202,7,129,194,36,226,216,254,8,87,5,169,153,69,148,49,43,175,114,123,47,179,127,2,3,16,134,107,76,66,28,225,98,181,60,127,38,206,224,59,9,151,63,147,243,164,11,194,78,128,34,105,13,221,18,86,11,7,237,26,222,203,41,227,100,221,226,85,56,140,87,85,10,167,200,156,95,158,29,179,70,166,32,51,227,25,175,157,199,0,73,101,255,164,82,94,120,41,181,240,90,26,14,31,199,125,147,78,224,188,83,211,74,126,42,98,11,178,216,46,104,213,26,234,39,24,148,91,202,84,132,243,38,187,112,42,178,190,104,98,155,121,32,25,229,49,12,231,151,79,136,108,46,228,176,50,206,25,46,61,204,128,7,92,35,235,120,40,56,12,26,115,22,88,132,252,84,168,255,168,238,194,250,226,180,174,153,66,78,18,255,159,215,226,42,108,171,73,198,95,191,253,253,213,243,87,23,111,110,216,114,20,37,123,179,126,178,126,194,126,141,237,166,59,140,236,69,59,166,170,105,170,252,12,249,122,181,28,117,249,233,214,16,154,128,16,179,56,178,138,141,241,190,111,
2,171,134,122,23,255,12,108,249,118,151,82,191,94,172,159,174,159,30,14,135,245,220,174,47,62,196,126,61,239,134,187,245,211,183,108,110,63,172,30,15,207,217,155,54,171,96,169,99,27,228,179,198,86,61,176,110,203,30,186,253,192,250,33,108,195,16,218,58,20,44,237,66,203,126,223,143,137,13,251,54,255,139,155,48,15,239,115,133,137,244,166,11,35,107,187,196,14,3,50,194,170,246,33,237,98,123,151,11,15,225,46,142,41,215,29,88,183,79,35,144,44,166,241,115,195,249,73,221,47,187,207,42,234,174,77,85,108,71,118,121,253,221,171,239,89,94,217,77,150,47,5,74,118,77,189,195,77,116,217,176,170,25,59,118,115,117,205,68,193,94,247,161,189,185,185,46,216,203,135,155,119,205,116,251,199,110,76,119,67,184,249,233,154,213,77,196,250,177,38,222,14,213,16,195,56,207,13,95,92,61,103,135,216,52,199,58,99,72,251,158,189,140,245,208,141,221,54,177,203,73,91,221,221,247,177,9,3,139,91,16,103,91,12,97,100,93,27,30,121,31,29,184,143,109,188,
223,223,179,47,86,61,207,231,113,100,150,25,133,78,105,199,48,209,0,31,251,42,213,59,152,182,133,45,71,63,39,179,246,71,89,255,130,225,4,116,255,23,248,68,15,86,244,125,19,235,41,47,227,35,183,213,234,31,27,10,231,202,
120,156,133,84,93,111,219,70,16,252,43,7,200,45,90,135,86,110,239,251,196,151,20,118,208,4,112,146,182,110,208,7,65,169,104,234,100,93,75,147,12,121,170,226,20,205,111,239,28,37,39,121,41,42,65,148,4,222,236,206,204,206,114,217,8,231,202,104,185,42,43,178,229,27,95,126,250,244,105,238,189,40,5,59,59,163,130,207,136,43,73,130,72,113,174,132,37,237,185,215,142,28,151,86,9,109,185,94,244,213,80,221,175,150,149,147,229,249,47,6,40,81,232,153,36,73,156,140,80,56,197,37,23,138,132,38,231,20,89,237,164,55,102,81,87,125,138,93,187,90,190,80,229,109,134,42,32,37,144,220,58,163,8,56,165,133,180,90,1,175,20,17,126,147,182,198,218,69,138,169,9,171,229,45,25,91,86,74,148,151,153,169,42,204,12,12,133,5,84,9,101,148,116,66,146,19,194,120,169,188,2,117,18,139,152,2,136,222,2,147,113,253,46,3,53,90,42,173,72,114,232,179,90,226,160,197,183,226,158,4,250,58,174,53,90,134,15,105,181,156,172,202,46,101,156,65,
67,97,117,62,237,148,35,105,157,80,194,8,80,224,22,82,115,127,189,216,132,177,6,78,10,42,19,72,149,151,207,116,73,0,219,194,206,4,247,92,24,235,209,16,116,33,89,122,79,210,161,161,34,205,73,46,234,110,147,101,10,205,229,212,209,97,24,6,149,39,87,180,33,16,22,210,161,165,37,41,113,213,202,217,197,24,242,56,82,55,172,150,253,238,252,217,119,124,206,231,66,235,239,115,1,143,2,78,42,41,149,241,138,184,68,35,84,81,217,51,195,49,82,210,194,45,110,171,17,93,147,202,238,78,206,18,7,12,230,75,167,37,154,27,92,48,91,72,148,112,71,120,229,164,116,124,81,55,213,56,126,101,209,121,150,73,84,16,205,108,118,86,75,161,124,182,71,10,88,44,140,246,4,143,181,81,92,44,134,240,126,31,135,112,31,90,152,28,17,145,242,113,68,167,56,130,204,49,142,162,32,129,64,106,99,120,118,76,35,17,66,106,88,206,201,41,48,194,27,99,78,167,68,222,126,209,32,11,146,51,47,148,4,19,175,20,28,64,1,242,68,196,29,222,80,6,
95,166,124,16,40,76,34,142,237,143,112,85,144,154,89,68,25,179,242,42,183,247,50,251,39,48,0,97,184,198,36,196,17,46,86,203,243,103,226,12,190,147,112,249,51,57,79,186,32,236,4,40,146,214,208,45,97,181,112,208,174,225,189,156,50,78,214,45,94,135,195,120,85,165,112,138,204,249,229,217,49,107,100,10,50,51,158,241,218,121,12,144,84,246,79,42,229,133,151,82,11,175,165,225,240,113,220,55,233,4,206,59,53,173,228,231,34,182,32,139,237,130,86,173,161,126,130,65,185,165,76,69,56,111,178,11,167,34,235,139,38,182,153,7,146,81,30,195,112,126,249,132,200,230,66,14,43,227,156,225,210,195,12,120,192,53,178,142,135,130,195,160,49,103,129,69,200,79,133,250,207,234,46,172,47,78,235,154,41,228,36,241,255,121,45,174,194,182,154,100,252,253,251,63,223,60,127,125,241,246,134,45,71,81,178,183,235,39,235,39,236,183,216,110,186,195,200,94,182,99,170,154,166,202,207,144,111,87,203,81,151,159,111,13,161,9,8,49,139,35,171,216,24,239,251,38,
176,106,168,119,241,175,192,150,239,118,41,245,235,197,250,233,250,233,225,112,88,207,237,250,226,99,236,215,243,110,184,91,63,125,199,230,246,227,234,241,240,156,189,109,179,10,150,58,182,65,62,107,108,213,3,235,182,236,161,219,15,172,31,194,54,12,161,173,67,193,210,46,180,236,143,253,152,216,176,111,243,191,184,9,243,240,33,87,152,72,111,186,48,178,182,75,236,48,32,35,172,106,31,210,46,182,119,185,240,16,238,226,152,114,221,129,117,251,52,2,201,98,26,191,52,156,159,212,253,186,251,162,162,238,218,84,197,118,100,151,215,63,188,254,145,229,149,221,100,249,82,160,100,215,212,59,220,68,151,13,171,154,177,99,55,87,215,76,20,236,77,31,218,155,155,235,130,189,122,184,121,223,76,183,127,234,198,116,55,132,155,159,175,89,221,68,172,31,107,226,237,80,13,49,140,243,220,240,229,213,115,118,136,77,115,172,51,134,180,239,217,171,88,15,221,216,109,19,187,156,180,213,221,125,31,155,48,176,184,5,113,182,197,16,70,214,181,225,145,247,209,129,251,216,198,251,
253,61,251,106,213,243,124,30,71,70,156,25,133,86,105,199,48,210,0,35,251,42,213,59,184,182,133,47,71,67,39,183,246,71,93,143,56,155,97,56,1,225,255,5,62,241,131,23,125,223,196,122,10,204,248,72,110,181,250,23,237,1,231,244,

View file

@ -367,16 +367,20 @@ void Ide::DeactivateBy(Ctrl *new_focus)
DeactivationSave(false);
}
TopWindow::DeactivateBy(new_focus);
win_deactivated = !new_focus || dynamic_cast<TopWindow *>(new_focus);
}
void Ide::Activate()
{
TriggerIndexer();
editor.TriggerSyncFile(0);
if(win_deactivated) {
TriggerIndexer();
editor.TriggerSyncFile(0);
TriggerIdeBackgroundThread(5000);
git_branch_cache.Clear();
win_deactivated = false;
}
TopWindow::Activate();
git_branch_cache.Clear();
MakeTitle();
TriggerIdeBackgroundThread(5000);
}
bool Ide::Key(dword key, int count)

View file

@ -653,6 +653,7 @@ public:
String libclang_coptions;
bool prefer_clang_format = false;
bool blk0_header = true;
bool win_deactivated = false;
// Formats editor's code with Ide format parameters
void FormatJSON_XML(bool xml);

View file

@ -104,6 +104,14 @@ file
Debug.cpp,
Valgrind.cpp,
Export.cpp,
Repo readonly separator,
urepo.h,
RepoConsole.cpp readonly,
RepoSync.cpp,
Credentials.cpp,
Diff.cpp,
DirRepoDiff.cpp,
urepo.lay,
Resources readonly separator,
ide.lay,
ide.iml,
@ -113,14 +121,6 @@ file
depends() xide.ico
depends() ide.ico,
theide.desktop,
Repo readonly separator,
urepo.h,
RepoConsole.cpp readonly,
RepoSync.cpp,
Credentials.cpp,
Diff.cpp,
DirRepoDiff.cpp,
urepo.lay,
Info readonly separator,
Copying;