mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-22 06:05:33 -06:00
.reference
git-svn-id: svn://ultimatepp.org/upp/trunk@7286 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
040913b8fd
commit
46389d54f2
8 changed files with 67 additions and 4 deletions
|
|
@ -22,7 +22,6 @@ CONSOLE_APP_MAIN
|
||||||
LOG(in.GetLine());
|
LOG(in.GetLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
HttpRequest http("www.ultimatepp.org");
|
HttpRequest http("www.ultimatepp.org");
|
||||||
InFilterStream in;
|
InFilterStream in;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@ description "Examples of using Core/POP3 package to download gmail emails\377";
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Core,
|
Core,
|
||||||
Core/POP3;
|
Core/POP3,
|
||||||
|
Core/SSL;
|
||||||
|
|
||||||
file
|
file
|
||||||
Pop3.cpp;
|
Pop3.cpp;
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,5 @@
|
||||||
#define _Pop3_icpp_init_stub
|
#define _Pop3_icpp_init_stub
|
||||||
#include "Core/init"
|
#include "Core/init"
|
||||||
#include "Core/POP3/init"
|
#include "Core/POP3/init"
|
||||||
|
#include "Core/SSL/init"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ GUI_APP_MAIN
|
||||||
{
|
{
|
||||||
PromptOK(DeQtf(SelectFileOpen("Text files\t*.txt\nAll files\t*.*")));
|
PromptOK(DeQtf(SelectFileOpen("Text files\t*.txt\nAll files\t*.*")));
|
||||||
|
|
||||||
PromptOK(DeQtf(SelectFileSaveAs("Text files\t*.txt\nAll files\t*.*")));
|
PromptOK(DeQtf(SelectFileSaveAs("Image files\t*.png *.jpg\nAll files\t*.*")));
|
||||||
|
|
||||||
SelectFileIn in("Text files\t*.txt");
|
SelectFileIn in("Text files\t*.txt");
|
||||||
if(in) {
|
if(in) {
|
||||||
|
|
|
||||||
47
reference/SplitJoinMerge/JoinMerge.cpp
Normal file
47
reference/SplitJoinMerge/JoinMerge.cpp
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
#include <Core/Core.h>
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
int DelimFn(int c)
|
||||||
|
{
|
||||||
|
return c == ';' || c == ' ' ? c : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *DelimTextFn(const char *s)
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
while(*s == ' ' || *s == ';') {
|
||||||
|
if(*s == ';')
|
||||||
|
found = true;
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
return found ? s : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
CONSOLE_APP_MAIN
|
||||||
|
{
|
||||||
|
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||||
|
|
||||||
|
DUMP(Split("one,two,,three", ','));
|
||||||
|
DUMP(Split("one,two,,three", ',', false));
|
||||||
|
DUMP(Split("one; two; three", DelimFn));
|
||||||
|
DUMP(Split(3, "one::two::three:x::four", "::"));
|
||||||
|
DUMP(Split("first something ; second;third something", DelimTextFn));
|
||||||
|
|
||||||
|
Vector<String> h; h << "1" << "2" << "3";
|
||||||
|
|
||||||
|
DUMP(Join(h, ", "));
|
||||||
|
|
||||||
|
String a, b, c;
|
||||||
|
DUMP(SplitTo("1;2;3", ';', a, b, c));
|
||||||
|
DUMP(a);
|
||||||
|
DUMP(b);
|
||||||
|
DUMP(c);
|
||||||
|
DUMP(SplitTo("1;2", ';', a, b, c));
|
||||||
|
|
||||||
|
DUMP(Merge("+", "hello", "", "world"));
|
||||||
|
|
||||||
|
String text = "something";
|
||||||
|
MergeWith(text, "_", "", "to", "", "merge");
|
||||||
|
DUMP(text);
|
||||||
|
}
|
||||||
11
reference/SplitJoinMerge/SplitJoinMerge.upp
Normal file
11
reference/SplitJoinMerge/SplitJoinMerge.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
description "Demostrates Split, SplitTo, Join, Merge, MergeWith functions\377";
|
||||||
|
|
||||||
|
uses
|
||||||
|
Core;
|
||||||
|
|
||||||
|
file
|
||||||
|
JoinMerge.cpp;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "SSE2";
|
||||||
|
|
||||||
4
reference/SplitJoinMerge/init
Normal file
4
reference/SplitJoinMerge/init
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#ifndef _SplitJoinMerge_icpp_init_stub
|
||||||
|
#define _SplitJoinMerge_icpp_init_stub
|
||||||
|
#include "Core/init"
|
||||||
|
#endif
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
description "Demostration of simple web-socket server\377";
|
description "Demonstration of simple web-socket server\377";
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Core;
|
Core;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue