pip 0.4.2 alpha r2
git-svn-id: svn://db.shs.com.ru/pip@3 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
project(pip)
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
include(CheckFunctionExists)
|
||||
@@ -178,7 +177,7 @@ if (DEFINED LIB)
|
||||
#list(APPEND HDRS "pip.h.gch")
|
||||
install(FILES "FindPIP.cmake" DESTINATION ${CMAKE_ROOT}/Modules)
|
||||
else ()
|
||||
install(TARGETS pip DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(TARGETS pip DESTINATION bin)
|
||||
message(STATUS "Install to local \"bin\"")
|
||||
endif ()
|
||||
|
||||
@@ -186,4 +185,3 @@ endif ()
|
||||
add_subdirectory("utils/system_test")
|
||||
add_subdirectory("utils/remote_console")
|
||||
add_subdirectory("utils/code_model_generator")
|
||||
add_subdirectory("utils/system_daemon")
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 3.2.1, 2015-02-19T18:12:48. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{948faa78-0b50-402e-a285-1bca3b08de64}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">false</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap"/>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">DesktopBuild</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">DesktopBuild</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{3c749452-9483-442d-b011-933a1b5dac10}</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="bool" key="CMakeProjectManager.CMakeBuildConfiguration.UseNinja">false</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/libs/pip</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments">-j8</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.Clean">false</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments">clean</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.Clean">true</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">all</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Установка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Локальная установка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">pip_test</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="CMakeProjectManager.CMakeRunConfiguration.UseTerminal">false</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">pip_test</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.pip_test</value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">pip_system_test</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="CMakeProjectManager.CMakeRunConfiguration.UseTerminal">false</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">pip_system_test</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.pip_system_test</value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.2">
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">pip_remote_console</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="CMakeProjectManager.CMakeRunConfiguration.UseTerminal">false</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">pip_remote_console</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.pip_remote_console</value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.3">
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">pip_cmg</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="CMakeProjectManager.CMakeRunConfiguration.UseTerminal">false</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">pip_cmg</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.pip_cmg</value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.4">
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">pisd</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="CMakeProjectManager.CMakeRunConfiguration.UseTerminal">true</value>
|
||||
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">pisd</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.pisd</value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">5</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">16</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">16</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
@@ -47,7 +47,7 @@ macro (pip_code_model SRC RESULT)
|
||||
endif ()
|
||||
if (NEED_PARSE)
|
||||
message(STATUS "Creating code model based on \"${SRC}\", please wait ... ")
|
||||
execute_process(COMMAND ${PIP_CMG} -qPEs -o ${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${SRC} OUTPUT_VARIABLE CMG_OUT)
|
||||
execute_process(COMMAND ${PIP_CMG} -qP -o ${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${SRC} OUTPUT_VARIABLE CMG_OUT)
|
||||
message(STATUS "Creating code model done, to use it include \"${PROJECT_NAME}_ccm.h\"")
|
||||
string(REPLACE "\n" ";" CMG_LIST ${CMG_OUT})
|
||||
string(REPLACE "\n" " " CMG_LIST_S ${CMG_OUT})
|
||||
|
||||
46
main.cpp
46
main.cpp
@@ -1,17 +1,19 @@
|
||||
#include "pip.h"
|
||||
#include "pifiletransfer.h"
|
||||
#include "pidatatransfer.h"
|
||||
|
||||
class Ob: public PIObject {
|
||||
PIOBJECT(Ob)
|
||||
public:
|
||||
Ob() {
|
||||
sft.setName("sft");
|
||||
sft.setDirectory(sft.directory().cd("..\\"));
|
||||
piCout << "Send File Transfer DIrectory" << sft.directory().absolutePath();
|
||||
//sft.setDirectory(sft.directory().cd("..\\"));
|
||||
//piCout << "Send File Transfer DIrectory" << sft.directory().absolutePath();
|
||||
CONNECTU(&sft, sendRequest, this, ssend);
|
||||
|
||||
rft.setName("rft");
|
||||
rft.setDirectory(rft.directory().cd("..\\1"));
|
||||
piCout << "Receive File Transfer DIrectory" << rft.directory().absolutePath();
|
||||
//rft.setDirectory(rft.directory().cd("..\\1"));
|
||||
//piCout << "Receive File Transfer DIrectory" << rft.directory().absolutePath();
|
||||
CONNECTU(&rft, sendRequest, this, rsend);
|
||||
}
|
||||
|
||||
@@ -19,12 +21,12 @@ public:
|
||||
PIDir dir = PIDir::current();
|
||||
dir.cd("..\\");
|
||||
piCout << dir.absolutePath();
|
||||
PIVector<PIDir::DirEntry> des = dir.allEntries();
|
||||
PIVector<PIFile::FileInfo> des = dir.allEntries();
|
||||
piCout << "all entries" << des.size();
|
||||
PIDir::DirEntry sde;
|
||||
piForeachC(PIDir::DirEntry de, des) {
|
||||
PIFile::FileInfo sde;
|
||||
piForeachC(PIFile::FileInfo de, des) {
|
||||
//piCout << (de.isDir() ? "dir:" : "file") << de.name << de.size;
|
||||
if (de.name == "0") sde = de;
|
||||
if (de.name() == "0") sde = de;
|
||||
}
|
||||
//sft.setPacketSize(64096);
|
||||
sft.send(sde);
|
||||
@@ -32,21 +34,21 @@ public:
|
||||
|
||||
private:
|
||||
EVENT_HANDLER1(void, ssend, PIByteArray &, data) {
|
||||
// piCout << "[sender]" << sft.stateString() << ". datasize =" << data.size()
|
||||
// << "(" << PIString::readableSize(sft.bytesFileCur()) << "/" << PIString::readableSize(sft.bytesFileAll()) << ", "
|
||||
// << PIString::readableSize(sft.bytesTotalCur()) << "/" << PIString::readableSize(sft.bytesTotalAll()) << ")";
|
||||
piCout << "[sender]" << sft.stateString() << ". datasize =" << data.size()
|
||||
<< "(" << PIString::readableSize(sft.bytesFileCur()) << "/" << PIString::readableSize(sft.bytesFileAll()) << ", "
|
||||
<< PIString::readableSize(sft.bytesTotalCur()) << "/" << PIString::readableSize(sft.bytesTotalAll()) << ")";
|
||||
if(rand()%100 != 90) rft.received(data);
|
||||
}
|
||||
|
||||
EVENT_HANDLER1(void, rsend, PIByteArray &, data) {
|
||||
// piCout << "[receiver]" << rft.stateString() << ". datasize =" << data.size()
|
||||
// << "(" << PIString::readableSize(rft.bytesFileCur()) << "/" << PIString::readableSize(rft.bytesFileAll()) << ", "
|
||||
// << PIString::readableSize(rft.bytesTotalCur()) << "/" << PIString::readableSize(rft.bytesTotalAll()) << ")";
|
||||
piCout << "[receiver]" << rft.stateString() << ". datasize =" << data.size()
|
||||
<< "(" << PIString::readableSize(rft.bytesFileCur()) << "/" << PIString::readableSize(rft.bytesFileAll()) << ", "
|
||||
<< PIString::readableSize(rft.bytesTotalCur()) << "/" << PIString::readableSize(rft.bytesTotalAll()) << ")";
|
||||
if(rand()%100 != 90) sft.received(data);
|
||||
}
|
||||
|
||||
PIFileTransfer sft;
|
||||
PIFileTransfer rft;
|
||||
PIBaseTransfer sft;
|
||||
PIBaseTransfer rft;
|
||||
};
|
||||
|
||||
|
||||
@@ -98,6 +100,11 @@ private:
|
||||
};
|
||||
|
||||
int main (int argc, char * argv[]) {
|
||||
Ob o;
|
||||
PITimeMeasurer tm;
|
||||
o.startsend();
|
||||
piCout << tm.elapsed_s();
|
||||
return 0;
|
||||
if (!(argc == 3 || argc == 4)) {
|
||||
piCout << "UDPFileTransfer";
|
||||
piCout << "USE: piptest [src_ip_port] [dst_ip_port] {filename}";
|
||||
@@ -119,11 +126,6 @@ int main (int argc, char * argv[]) {
|
||||
}
|
||||
WAIT_FOR_EXIT
|
||||
return 0;
|
||||
// Ob o;
|
||||
// ft.setPacketSize(65536);
|
||||
// PITimeMeasurer tm;
|
||||
// o.startsend();
|
||||
// piCout << tm.elapsed_s();
|
||||
// return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
83
pip.cbp
83
pip.cbp
@@ -5,7 +5,7 @@
|
||||
<Option title="pip" />
|
||||
<Option makefile_is_custom="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option virtualFolders="CMake Files\;CMake Files\utils\;CMake Files\utils\system_test\;CMake Files\utils\remote_console\;CMake Files\utils\code_model_generator\;CMake Files\utils\system_daemon\;" />
|
||||
<Option virtualFolders="CMake Files\;CMake Files\utils\;CMake Files\utils\system_test\;CMake Files\utils\remote_console\;CMake Files\utils\code_model_generator\;" />
|
||||
<Build>
|
||||
<Target title="all">
|
||||
<Option working_dir="C:/libs/pip" />
|
||||
@@ -387,68 +387,6 @@
|
||||
<DistClean command="C:/mingw/x32/bin/mingw32-make.exe -f "C:/libs/pip/utils/code_model_generator/Makefile" VERBOSE=1 clean" />
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="pisd">
|
||||
<Option output="C:/libs/pip/utils/system_daemon/pisd.exe" prefix_auto="0" extension_auto="0" />
|
||||
<Option working_dir="C:/libs/pip/utils/system_daemon" />
|
||||
<Option object_output="./" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add directory="C:/libs/pip" />
|
||||
<Add directory="C:/libs/pip/src" />
|
||||
<Add directory="C:/libs/pip/src/." />
|
||||
<Add directory="C:/libs/pip/src/code" />
|
||||
<Add directory="C:/libs/pip/src/containers" />
|
||||
<Add directory="C:/libs/pip/src/core" />
|
||||
<Add directory="C:/libs/pip/src/io" />
|
||||
<Add directory="C:/libs/pip/src/math" />
|
||||
<Add directory="C:/libs/pip/src/system" />
|
||||
<Add directory="C:/libs/pip/src/thread" />
|
||||
<Add directory="C:/mingw/x32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/include" />
|
||||
<Add directory="C:/mingw/x32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/include" />
|
||||
<Add directory="C:/mingw/x32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/include-fixed" />
|
||||
<Add directory="C:/mingw/x32/lib/gcc/../../i686-w64-mingw32/include/c++" />
|
||||
<Add directory="C:/mingw/x32/lib/gcc/../../i686-w64-mingw32/include/c++/backward" />
|
||||
<Add directory="C:/mingw/x32/lib/gcc/../../i686-w64-mingw32/include/c++/i686-w64-mingw32" />
|
||||
</Compiler>
|
||||
<MakeCommands>
|
||||
<Build command="C:/mingw/x32/bin/mingw32-make.exe -f "C:/libs/pip/utils/system_daemon/Makefile" VERBOSE=1 pisd" />
|
||||
<CompileFile command="C:/mingw/x32/bin/mingw32-make.exe -f "C:/libs/pip/utils/system_daemon/Makefile" VERBOSE=1 "$file"" />
|
||||
<Clean command="C:/mingw/x32/bin/mingw32-make.exe -f "C:/libs/pip/utils/system_daemon/Makefile" VERBOSE=1 clean" />
|
||||
<DistClean command="C:/mingw/x32/bin/mingw32-make.exe -f "C:/libs/pip/utils/system_daemon/Makefile" VERBOSE=1 clean" />
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="pisd/fast">
|
||||
<Option output="C:/libs/pip/utils/system_daemon/pisd.exe" prefix_auto="0" extension_auto="0" />
|
||||
<Option working_dir="C:/libs/pip/utils/system_daemon" />
|
||||
<Option object_output="./" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add directory="C:/libs/pip" />
|
||||
<Add directory="C:/libs/pip/src" />
|
||||
<Add directory="C:/libs/pip/src/." />
|
||||
<Add directory="C:/libs/pip/src/code" />
|
||||
<Add directory="C:/libs/pip/src/containers" />
|
||||
<Add directory="C:/libs/pip/src/core" />
|
||||
<Add directory="C:/libs/pip/src/io" />
|
||||
<Add directory="C:/libs/pip/src/math" />
|
||||
<Add directory="C:/libs/pip/src/system" />
|
||||
<Add directory="C:/libs/pip/src/thread" />
|
||||
<Add directory="C:/mingw/x32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/include" />
|
||||
<Add directory="C:/mingw/x32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/include" />
|
||||
<Add directory="C:/mingw/x32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/include-fixed" />
|
||||
<Add directory="C:/mingw/x32/lib/gcc/../../i686-w64-mingw32/include/c++" />
|
||||
<Add directory="C:/mingw/x32/lib/gcc/../../i686-w64-mingw32/include/c++/backward" />
|
||||
<Add directory="C:/mingw/x32/lib/gcc/../../i686-w64-mingw32/include/c++/i686-w64-mingw32" />
|
||||
</Compiler>
|
||||
<MakeCommands>
|
||||
<Build command="C:/mingw/x32/bin/mingw32-make.exe -f "C:/libs/pip/utils/system_daemon/Makefile" VERBOSE=1 pisd/fast" />
|
||||
<CompileFile command="C:/mingw/x32/bin/mingw32-make.exe -f "C:/libs/pip/utils/system_daemon/Makefile" VERBOSE=1 "$file"" />
|
||||
<Clean command="C:/mingw/x32/bin/mingw32-make.exe -f "C:/libs/pip/utils/system_daemon/Makefile" VERBOSE=1 clean" />
|
||||
<DistClean command="C:/mingw/x32/bin/mingw32-make.exe -f "C:/libs/pip/utils/system_daemon/Makefile" VERBOSE=1 clean" />
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
</Build>
|
||||
<Unit filename="C:/libs/pip/main.cpp">
|
||||
</Unit>
|
||||
@@ -490,8 +428,6 @@
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/src/io/pifile.cpp">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/src/io/pifiletransfer.cpp">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/src/io/piiodevice.cpp">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/src/io/piiostring.cpp">
|
||||
@@ -542,12 +478,6 @@
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/utils/remote_console/main.cpp">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/utils/system_daemon/daemon.cpp">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/utils/system_daemon/file_manager.cpp">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/utils/system_daemon/main.cpp">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/utils/system_test/main.cpp">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/pip_resource_win.rc">
|
||||
@@ -590,8 +520,6 @@
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/src/io/pifile.h">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/src/io/pifiletransfer.h">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/src/io/piiodevice.h">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/src/io/piiostring.h">
|
||||
@@ -638,12 +566,6 @@
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/src/thread/pitimer.h">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/utils/system_daemon/daemon.h">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/utils/system_daemon/file_manager.h">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/utils/system_daemon/shared.h">
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/CMakeLists.txt">
|
||||
<Option virtualFolder="CMake Files\" />
|
||||
</Unit>
|
||||
@@ -656,8 +578,5 @@
|
||||
<Unit filename="C:/libs/pip/utils/code_model_generator/CMakeLists.txt">
|
||||
<Option virtualFolder="CMake Files\utils\code_model_generator\" />
|
||||
</Unit>
|
||||
<Unit filename="C:/libs/pip/utils/system_daemon/CMakeLists.txt">
|
||||
<Option virtualFolder="CMake Files\utils\system_daemon\" />
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
|
||||
39
src/pip.h
Executable file
39
src/pip.h
Executable file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
All includes
|
||||
Copyright (C) 2014 Ivan Pelipenko peri4ko@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "pitimer.h"
|
||||
#include "pivariant.h"
|
||||
#include "piconsole.h"
|
||||
#include "picli.h"
|
||||
#include "pievaluator.h"
|
||||
#include "pimultiprotocol.h"
|
||||
#include "picodec.h"
|
||||
#include "pisignals.h"
|
||||
#include "piobject.h"
|
||||
#include "pisystemmonitor.h"
|
||||
#include "pisysteminfo.h"
|
||||
#include "pipeer.h"
|
||||
#include "picrc.h"
|
||||
#include "pistatemachine.h"
|
||||
#include "picollection.h"
|
||||
#include "piserial.h"
|
||||
#include "pibinarylog.h"
|
||||
#include "piusb.h"
|
||||
#include "piiostring.h"
|
||||
#include "piconnection.h"
|
||||
35
src/pip_export.h
Executable file
35
src/pip_export.h
Executable file
@@ -0,0 +1,35 @@
|
||||
|
||||
#ifndef PIP_EXPORT_H
|
||||
#define PIP_EXPORT_H
|
||||
|
||||
#ifdef PIP_STATIC_DEFINE
|
||||
# define PIP_EXPORT
|
||||
# define PIP_NO_EXPORT
|
||||
#else
|
||||
# ifndef PIP_EXPORT
|
||||
# ifdef pip_EXPORTS
|
||||
/* We are building this library */
|
||||
# define PIP_EXPORT __attribute__((visibility("default")))
|
||||
# else
|
||||
/* We are using this library */
|
||||
# define PIP_EXPORT __attribute__((visibility("default")))
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef PIP_NO_EXPORT
|
||||
# define PIP_NO_EXPORT __attribute__((visibility("hidden")))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef PIP_DEPRECATED
|
||||
# define PIP_DEPRECATED __attribute__ ((__deprecated__))
|
||||
# define PIP_DEPRECATED_EXPORT PIP_EXPORT __attribute__ ((__deprecated__))
|
||||
# define PIP_DEPRECATED_NO_EXPORT PIP_NO_EXPORT __attribute__ ((__deprecated__))
|
||||
#endif
|
||||
|
||||
#define DEFINE_NO_DEPRECATED 0
|
||||
#if DEFINE_NO_DEPRECATED
|
||||
# define PIP_NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#endif
|
||||
1
src/pip_version_str.h
Normal file
1
src/pip_version_str.h
Normal file
@@ -0,0 +1 @@
|
||||
#define __PIP_VERSION_STR__ "0.4.2_alpha"
|
||||
101
src/piplatform.h
Normal file
101
src/piplatform.h
Normal file
@@ -0,0 +1,101 @@
|
||||
#ifndef PIPLATFORM_H
|
||||
#define PIPLATFORM_H
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
|
||||
# define WINDOWS
|
||||
# define ARCH_BITS_32
|
||||
#endif
|
||||
#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
|
||||
# define WINDOWS
|
||||
# define ARCH_BITS_64
|
||||
#endif
|
||||
#if defined(__QNX__) || defined(__QNXNTO__)
|
||||
# define QNX
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
# define FREE_BSD
|
||||
#endif
|
||||
#if defined(__APPLE__) || defined(__MACH__)
|
||||
# define MAC_OS
|
||||
#endif
|
||||
#if defined(__ANDROID__) || defined(_ANDROID_) || defined(ANDROID)
|
||||
# ifndef ANDROID
|
||||
# define ANDROID
|
||||
# endif
|
||||
#endif
|
||||
#ifndef WINDOWS
|
||||
# ifndef QNX
|
||||
# ifndef FREE_BSD
|
||||
# ifndef MAC_OS
|
||||
# ifndef ANDROID
|
||||
# define LINUX
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef WINDOWS
|
||||
# if defined(__LP64__) || defined(_LP64_) || defined(LP64)
|
||||
# define ARCH_BITS_64
|
||||
# else
|
||||
# define ARCH_BITS_32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define CC_GCC
|
||||
# define CC_GCC_VERSION ((__GNUC__ << 8) | __GNUC_MINOR__)
|
||||
# if CC_GCC_VERSION > 0x025F // > 2.95
|
||||
# ifdef LINUX
|
||||
# define HAS_LOCALE
|
||||
# endif
|
||||
# pragma GCC diagnostic ignored "-Wpragmas"
|
||||
# pragma GCC diagnostic ignored "-Wformat"
|
||||
# pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
# pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
|
||||
# endif
|
||||
# ifdef ANDROID
|
||||
# pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
# pragma GCC diagnostic ignored "-Wextra"
|
||||
# pragma GCC diagnostic ignored "-Wliteral-suffix"
|
||||
# endif
|
||||
# define DEPRECATED __attribute__((deprecated))
|
||||
#elif defined(_MSC_VER)
|
||||
# define CC_VC
|
||||
# pragma warning(disable: 4018)
|
||||
# pragma warning(disable: 4061)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4239)
|
||||
# pragma warning(disable: 4242)
|
||||
# pragma warning(disable: 4244)
|
||||
# pragma warning(disable: 4251)
|
||||
# pragma warning(disable: 4365)
|
||||
# pragma warning(disable: 4512)
|
||||
# pragma warning(disable: 4668)
|
||||
# pragma warning(disable: 4710)
|
||||
# pragma warning(disable: 4800)
|
||||
# pragma warning(disable: 4820)
|
||||
# pragma warning(disable: 4986)
|
||||
# pragma warning(disable: 4996)
|
||||
# define DEPRECATED
|
||||
# ifdef ARCH_BITS_32
|
||||
typedef long ssize_t;
|
||||
# else
|
||||
typedef long long ssize_t;
|
||||
# endif
|
||||
#else
|
||||
# define CC_OTHER
|
||||
# define DEPRECATED
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS
|
||||
# ifdef CC_GCC
|
||||
# define typeof __typeof
|
||||
# endif
|
||||
#else
|
||||
# define typeof __typeof__
|
||||
#endif
|
||||
|
||||
#endif // PIPLATFORM_H
|
||||
10
src/piversion.h
Normal file
10
src/piversion.h
Normal file
@@ -0,0 +1,10 @@
|
||||
// 108 141 174 cmake version offset
|
||||
#ifndef PIVERSION_H
|
||||
#define PIVERSION_H
|
||||
|
||||
#define PIP_VERSION_MAJOR 0
|
||||
#define PIP_VERSION_MINOR 4
|
||||
#define PIP_VERSION_REVISION 2
|
||||
#define PIP_VERSION_SUFFIX "_alpha"
|
||||
|
||||
#endif // PIVERSION_H
|
||||
Reference in New Issue
Block a user