You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: QPingSF/QPing.cpp
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
/*
2
+
The MIT License
3
+
SPDX short identifier: MIT https://opensource.org/licenses/MIT
4
+
Copyright 2018-. j2doll https://github.com/j2doll
5
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copy file name to clipboardExpand all lines: QPingSF/QPing.h
+19-4Lines changed: 19 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
7
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and # to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+
1
11
QT -= gui
2
12
3
-
CONFIG += c++11 console
13
+
CONFIG += c++11
14
+
CONFIG += console
4
15
CONFIG -= app_bundle
5
16
6
17
# The following define makes your compiler emit warnings if you use
Copy file name to clipboardExpand all lines: QPingSF/main.cpp
+20-7Lines changed: 20 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
/*
2
+
The MIT License
3
+
SPDX short identifier: MIT https://opensource.org/licenses/MIT
4
+
Copyright 2018-. j2doll https://github.com/j2doll
5
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8
+
*/
9
+
1
10
// main.cpp
2
11
3
12
#include<QtGlobal>
@@ -16,24 +25,24 @@ int main(int argc, char *argv[])
16
25
{
17
26
QCoreApplication a(argc, argv);
18
27
19
-
QString destIpAddress = "192.168.0.1";
28
+
QString destIpAddress = "192.168.0.10";
20
29
if ( argc == 2 )
21
30
{
22
31
// You can use application first parameter
23
-
// For example) QPingSF 192.168.100.10
32
+
// For example) QPingSF 192.168.200.50
24
33
QString strArg = argv[1];
25
34
destIpAddress = strArg;
26
35
}
27
36
28
-
// see sample of *.ini for OS (You can
37
+
// Define your OS and OS language.
38
+
// See sample of *.ini for OS. (You can define your own INI file)
29
39
QString iniFilePath = "./ping-config-win-en.ini"; // Windows, English
30
40
// QString iniFilePath = "./ping-config-win-kr.ini"; // Windows, Korean
31
41
// QString iniFilePath = "./ping-config-linux-en.ini"; // Linux, English
32
42
33
-
QPing qp;
43
+
QPing qp;// main class
34
44
35
-
// set configuration file
36
-
qp.setIniFile( iniFilePath );
45
+
qp.setIniFile( iniFilePath ); // set configuration file
37
46
if ( ! qp.loadIniFile() )
38
47
{
39
48
std::cout << "[ERROR] Failed to load ini file" << std::endl;
@@ -60,8 +69,12 @@ int main(int argc, char *argv[])
60
69
case QPing::notFound: // something wrong
61
70
std::cout << "[ERROR] Result is not found" << std::endl;
62
71
break;
72
+
73
+
default:
74
+
std::cout << "Undefined result : " << ((quint32)result) << std::endl;
0 commit comments