├── LICENSE ├── POCO 라이브러리 Log.pptx ├── POCO 라이브러리 Strings_Text_and_Formatting.pptx ├── POCO 라이브러리 사용하기.pdf ├── POCO 라이브러리 사용하기.pptx ├── POCO 라이브러리 파일 다루기.pptx ├── PocoSamples ├── Bin │ └── config_server.ini ├── PocoSamples.sln ├── PocoSamples.vcxproj ├── PocoSamples.vcxproj.filters └── Samples │ ├── Samples.vcxproj │ ├── Samples.vcxproj.filters │ ├── cache.h │ ├── checksum.h │ ├── dateTime.h │ ├── delegate.h │ ├── dynamicFactory.h │ ├── environment.h │ ├── iniReader.h │ ├── main.cpp │ ├── notificationcenter.h │ ├── serverApplication.h │ ├── singletonholder.h │ ├── stopwatch.h │ └── workerThread.h ├── README.md ├── build.md └── resource ├── PocoVCInclude.png └── PocoVCLib.png /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Choi HeungBae 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /POCO 라이브러리 Log.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/POCO 라이브러리 Log.pptx -------------------------------------------------------------------------------- /POCO 라이브러리 Strings_Text_and_Formatting.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/POCO 라이브러리 Strings_Text_and_Formatting.pptx -------------------------------------------------------------------------------- /POCO 라이브러리 사용하기.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/POCO 라이브러리 사용하기.pdf -------------------------------------------------------------------------------- /POCO 라이브러리 사용하기.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/POCO 라이브러리 사용하기.pptx -------------------------------------------------------------------------------- /POCO 라이브러리 파일 다루기.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/POCO 라이브러리 파일 다루기.pptx -------------------------------------------------------------------------------- /PocoSamples/Bin/config_server.ini: -------------------------------------------------------------------------------- 1 | [ChannelServer] 2 | CHANNEL_COUNT=100 3 | CHANNEL_USER_COUNT= 300 -------------------------------------------------------------------------------- /PocoSamples/PocoSamples.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2003 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Samples", "Samples\Samples.vcxproj", "{355C1C77-E465-4B4A-B1F0-00EE9F47AA22}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {355C1C77-E465-4B4A-B1F0-00EE9F47AA22}.Debug|x64.ActiveCfg = Debug|x64 17 | {355C1C77-E465-4B4A-B1F0-00EE9F47AA22}.Debug|x64.Build.0 = Debug|x64 18 | {355C1C77-E465-4B4A-B1F0-00EE9F47AA22}.Debug|x86.ActiveCfg = Debug|Win32 19 | {355C1C77-E465-4B4A-B1F0-00EE9F47AA22}.Debug|x86.Build.0 = Debug|Win32 20 | {355C1C77-E465-4B4A-B1F0-00EE9F47AA22}.Release|x64.ActiveCfg = Release|x64 21 | {355C1C77-E465-4B4A-B1F0-00EE9F47AA22}.Release|x64.Build.0 = Release|x64 22 | {355C1C77-E465-4B4A-B1F0-00EE9F47AA22}.Release|x86.ActiveCfg = Release|Win32 23 | {355C1C77-E465-4B4A-B1F0-00EE9F47AA22}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {E676F0C4-86F2-4A70-8C5B-4B0AC74586EB} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /PocoSamples/PocoSamples.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {ECE95AB6-3C0F-47D5-8937-D42A3BD900A0} 24 | PocoSamples 25 | 10.0.17134.0 26 | 27 | 28 | 29 | Application 30 | true 31 | v141 32 | MultiByte 33 | 34 | 35 | Application 36 | false 37 | v141 38 | true 39 | MultiByte 40 | 41 | 42 | Application 43 | true 44 | v141 45 | MultiByte 46 | 47 | 48 | Application 49 | false 50 | v141 51 | true 52 | MultiByte 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Level3 76 | Disabled 77 | true 78 | true 79 | 80 | 81 | 82 | 83 | Level3 84 | Disabled 85 | true 86 | true 87 | 88 | 89 | 90 | 91 | Level3 92 | MaxSpeed 93 | true 94 | true 95 | true 96 | true 97 | 98 | 99 | true 100 | true 101 | 102 | 103 | 104 | 105 | Level3 106 | MaxSpeed 107 | true 108 | true 109 | true 110 | true 111 | 112 | 113 | true 114 | true 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /PocoSamples/PocoSamples.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /PocoSamples/Samples/Samples.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {355C1C77-E465-4B4A-B1F0-00EE9F47AA22} 24 | Win32Proj 25 | Samples 26 | 10.0.17134.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v141 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v141 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v141 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v141 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | true 78 | $(SolutionDir)\Bin\ 79 | $(ProjectName)_D 80 | 81 | 82 | false 83 | 84 | 85 | false 86 | $(SolutionDir)\Bin\ 87 | 88 | 89 | 90 | Level3 91 | Disabled 92 | true 93 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 94 | true 95 | 96 | 97 | true 98 | Console 99 | 100 | 101 | 102 | 103 | Level3 104 | Disabled 105 | true 106 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 107 | true 108 | MultiThreadedDebug 109 | 110 | 111 | true 112 | Console 113 | 114 | 115 | 116 | 117 | Level3 118 | MaxSpeed 119 | true 120 | true 121 | true 122 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 123 | true 124 | 125 | 126 | true 127 | true 128 | true 129 | Console 130 | 131 | 132 | 133 | 134 | Level3 135 | MaxSpeed 136 | true 137 | true 138 | true 139 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 140 | true 141 | MultiThreaded 142 | 143 | 144 | true 145 | true 146 | true 147 | Console 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /PocoSamples/Samples/Samples.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | {f04732c6-11f6-499b-a50d-9f66f37720f5} 9 | 10 | 11 | 12 | 13 | poco 14 | 15 | 16 | poco 17 | 18 | 19 | poco 20 | 21 | 22 | poco 23 | 24 | 25 | poco 26 | 27 | 28 | poco 29 | 30 | 31 | poco 32 | 33 | 34 | poco 35 | 36 | 37 | poco 38 | 39 | 40 | poco 41 | 42 | 43 | poco 44 | 45 | 46 | poco 47 | 48 | 49 | -------------------------------------------------------------------------------- /PocoSamples/Samples/cache.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/PocoSamples/Samples/cache.h -------------------------------------------------------------------------------- /PocoSamples/Samples/checksum.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | void Sample_Checksum() 6 | { 7 | std::cout << "[ Sample_Checksum ]" << std::endl; 8 | 9 | char buffer[] = { "0123456789" }; 10 | 11 | Poco::Checksum checker1(Poco::Checksum::TYPE_ADLER32); 12 | checker1.update(buffer, 10); 13 | 14 | std::cout << checker1.checksum() << std::endl; 15 | 16 | 17 | Poco::Checksum checker2(Poco::Checksum::TYPE_CRC32); 18 | checker2.update(buffer, 10); 19 | 20 | std::cout << checker2.checksum() << std::endl; 21 | 22 | std::cout << std::endl << std::endl; 23 | } -------------------------------------------------------------------------------- /PocoSamples/Samples/dateTime.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | 11 | void displayDateTime(const Poco::DateTime& dateTime) 12 | { 13 | std::cout << Poco::format(" year = %d", dateTime.year()) << std::endl; 14 | std::cout << Poco::format(" month = %d\t(1 to 12)", dateTime.month()) << std::endl; 15 | std::cout << Poco::format(" day = %d\t(1 to 31)", dateTime.day()) << std::endl; 16 | std::cout << Poco::format(" hour = %d\t(0 to 23)", dateTime.hour()) << std::endl; 17 | std::cout << Poco::format(" minute = %d\t(0 to 59)", dateTime.minute()) << std::endl; 18 | std::cout << Poco::format(" second = %d\t(0 to 59)", dateTime.second()) << std::endl; 19 | std::cout << Poco::format(" millisecond = %d\t(0 to 999)", dateTime.millisecond()) << std::endl; 20 | std::cout << Poco::format(" microsecond = %d\t(0 to 999)", dateTime.microsecond()) << std::endl; 21 | std::cout << Poco::format(" isAM = %s\t(true or false)", std::string(dateTime.isAM() ? "true" : "false")) << std::endl; 22 | std::cout << Poco::format(" isPM = %s\t(true or false)", std::string(dateTime.isPM() ? "true" : "false")) << std::endl; 23 | std::cout << Poco::format(" isLeapYear = %s\t(true or false)", std::string(Poco::DateTime::isLeapYear(dateTime.year()) ? "true" : "false")) << std::endl; 24 | std::cout << Poco::format(" hourAMPM = %d\t(0 to 12)", dateTime.hourAMPM()) << std::endl; 25 | std::cout << Poco::format(" dayOfWeek = %d\t(0 to 6, 0: Sunday)", dateTime.dayOfWeek()) << std::endl; 26 | std::cout << Poco::format(" dayOfYear = %d\t(1 to 366, 1: January 1)", dateTime.dayOfYear()) << std::endl; 27 | std::cout << Poco::format(" daysOfMonth = %d\t(1 to 366, 1: January 1)", Poco::DateTime::daysOfMonth(dateTime.year(), dateTime.month())) << std::endl; 28 | std::cout << Poco::format(" week = %d\t(0 to 53, 1: the week containing January 4)", dateTime.week()) << std::endl; 29 | } 30 | 31 | void IntUnixTime() 32 | { 33 | Poco::DateTime dateTime; 34 | auto now = dateTime.timestamp(); 35 | 36 | std::cout << "epochMicroseconds" << now.epochMicroseconds() << std::endl; 37 | std::cout << "epochMicroseconds" << now.epochTime() << std::endl; 38 | } 39 | 40 | void Sample_DateTime() 41 | { 42 | std::cout << "[ Sample_DateTime ]" << std::endl; 43 | 44 | Poco::DateTime dateTime; 45 | 46 | std::cout << " Current DateTime (UTC)" << std::endl; 47 | displayDateTime(dateTime); 48 | 49 | 50 | std::cout << Poco::format(" Current DateTime (Locat Time: %s [GMT%+d])", Poco::Timezone::name(), Poco::Timezone::tzd() / (60 * 60)) << std::endl; 51 | dateTime.makeLocal(Poco::Timezone::tzd()); 52 | displayDateTime(dateTime); 53 | 54 | std::cout << Poco::format(Poco::DateTimeFormatter::format(dateTime, " DateTimeFormatter: %w %b %e %H:%M:%S %%s %Y"), Poco::Timezone::name()) << std::endl; 55 | 56 | 57 | IntUnixTime(); 58 | 59 | std::cout << std::endl << std::endl; 60 | } -------------------------------------------------------------------------------- /PocoSamples/Samples/delegate.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/PocoSamples/Samples/delegate.h -------------------------------------------------------------------------------- /PocoSamples/Samples/dynamicFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | enum EShapeType 11 | { 12 | eTriangle = 0 13 | , eRectangle 14 | , eOval 15 | , eNumShapes 16 | }; 17 | 18 | const std::string kShapeNames[] = 19 | { 20 | "Triangle" 21 | , "Rectangle" 22 | , "Oval" 23 | }; 24 | 25 | class Shape 26 | { 27 | public: 28 | Shape(){ } 29 | 30 | virtual ~Shape() {} 31 | 32 | virtual void draw(void) = 0; 33 | 34 | protected: 35 | void draw(const std::string& str) 36 | { 37 | std::cout << "Shape" << std::endl; 38 | } 39 | }; 40 | 41 | class TriangleShape : public Shape 42 | { 43 | public: 44 | void draw(void) 45 | { 46 | std::cout << "Triangle" << std::endl; 47 | } 48 | }; 49 | 50 | class RectangleShape : public Shape 51 | { 52 | public: 53 | void draw(void) 54 | { 55 | std::cout << "Rectangle" << std::endl; 56 | } 57 | }; 58 | 59 | class OvalShape : public Shape 60 | { 61 | public: 62 | void draw(void) 63 | { 64 | std::cout << "Oval" << std::endl; 65 | } 66 | }; 67 | 68 | 69 | void RegisterClass(Poco::DynamicFactory& shapeFactory) 70 | { 71 | shapeFactory.registerClass("TriangleShape"); 72 | shapeFactory.registerClass("RectangleShape"); 73 | shapeFactory.registerClass("OvalShape"); 74 | } 75 | 76 | void Sample_DynamicFactory() 77 | { 78 | std::cout << "[ Sample_DynamicFactory ]" << std::endl; 79 | 80 | Poco::DynamicFactory shapeFactory; 81 | 82 | RegisterClass(shapeFactory); 83 | 84 | 85 | auto shape1 = shapeFactory.createInstance("TriangleShape"); 86 | shape1->draw(); 87 | 88 | auto shape2 = shapeFactory.createInstance("RectangleShape"); 89 | shape2->draw(); 90 | 91 | auto shape3 = shapeFactory.createInstance("OvalShape"); 92 | shape3->draw(); 93 | 94 | std::cout << std::endl << std::endl; 95 | } -------------------------------------------------------------------------------- /PocoSamples/Samples/environment.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/PocoSamples/Samples/environment.h -------------------------------------------------------------------------------- /PocoSamples/Samples/iniReader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/PocoSamples/Samples/iniReader.h -------------------------------------------------------------------------------- /PocoSamples/Samples/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma comment(lib, "IPHLPAPI.lib") 3 | 4 | #include "iniReader.h" 5 | #include "stopwatch.h" 6 | #include "singletonholder.h" 7 | #include "cache.h" 8 | #include "checksum.h" 9 | #include "dynamicFactory.h" 10 | #include "workerThread.h" 11 | #include "dateTime.h" 12 | #include "delegate.h" 13 | #include "notificationcenter.h" 14 | #include "environment.h" 15 | #include "serverApplication.h" 16 | 17 | 18 | int main(int argc, char** argv) 19 | { 20 | Sample_iniReader(); 21 | 22 | Sample_StopWatch(); 23 | 24 | Sample_SingletonHolder(); 25 | 26 | Sample_LRUCache(); 27 | 28 | Sample_ExpireCache(); 29 | 30 | Sample_Checksum(); 31 | 32 | Sample_DynamicFactory(); 33 | 34 | Sample_WorkerThread(); 35 | 36 | Sample_DateTime(); 37 | 38 | Sample_Delegate(); 39 | 40 | Sample_NotificationCenter(); 41 | 42 | Sample_Environment(); 43 | 44 | Sample_ServerApplication(argc, argv); 45 | 46 | 47 | getchar(); 48 | return 0; 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /PocoSamples/Samples/notificationcenter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | class BaseNotification : public Poco::Notification 11 | { 12 | public: 13 | BaseNotification(int data) : 14 | m_data(data) 15 | { 16 | } 17 | 18 | int data() const 19 | { 20 | return m_data; 21 | } 22 | 23 | private: 24 | int m_data; 25 | }; 26 | 27 | 28 | class ObserverWorker 29 | { 30 | public: 31 | ObserverWorker() = default; 32 | 33 | ObserverWorker(std::string name) 34 | { 35 | m_Name = name; 36 | } 37 | 38 | void handleNotification(Poco::Notification* pNf) 39 | { 40 | Poco::AutoPtr< BaseNotification > pNotification = dynamic_cast(pNf); 41 | if (pNotification) 42 | { 43 | std::cout << Poco::format("%s - handleNotification got BaseNotification(%d)\n", m_Name, pNotification->data()); 44 | } 45 | } 46 | 47 | void handleNotification2(BaseNotification* pNf) 48 | { 49 | std::cout << Poco::format("%s - handleNotification got BaseNotification2(%d)\n", m_Name, pNf->data()); 50 | } 51 | 52 | private: 53 | std::string m_Name; 54 | }; 55 | 56 | void Sample_NotificationCenter() 57 | { 58 | std::cout << "[ Sample_NotificationCenter ]" << std::endl; 59 | 60 | Poco::NotificationCenter nc; 61 | 62 | ObserverWorker worker1(std::string("worker1")); 63 | ObserverWorker worker2(std::string("worker2")); 64 | ObserverWorker worker3(std::string("worker3")); 65 | 66 | nc.addObserver(Poco::Observer(worker1, &ObserverWorker::handleNotification)); 67 | nc.addObserver(Poco::Observer(worker2, &ObserverWorker::handleNotification)); 68 | nc.addObserver(Poco::Observer(worker3, &ObserverWorker::handleNotification2)); 69 | 70 | 71 | nc.postNotification(new BaseNotification(0)); 72 | nc.postNotification(new BaseNotification(1)); 73 | nc.postNotification(new BaseNotification(2)); 74 | 75 | std::cout << std::endl << std::endl; 76 | } -------------------------------------------------------------------------------- /PocoSamples/Samples/serverApplication.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/PocoSamples/Samples/serverApplication.h -------------------------------------------------------------------------------- /PocoSamples/Samples/singletonholder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/PocoSamples/Samples/singletonholder.h -------------------------------------------------------------------------------- /PocoSamples/Samples/stopwatch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/PocoSamples/Samples/stopwatch.h -------------------------------------------------------------------------------- /PocoSamples/Samples/workerThread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/PocoSamples/Samples/workerThread.h -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CookBookPOCOCpp 2 | C++ 오픈소스 POCO 사용법 정리 3 | -------------------------------------------------------------------------------- /build.md: -------------------------------------------------------------------------------- 1 | ## 개요 2 | - 다운로드: http://pocoproject.org/download/index.html 3 | - 문서: http://pocoproject.org/documentation/index.html 4 | 5 | 6 | ## Windows 7 | - VS2010, x64, static lib 으로 빌드 8 | - buildwin.cmd 100 build static_mt both x64 samples tests devenv 9 | - 이렇게 빌드하면 PocoFoundation만 빌드 된다. 그래서 Util, XML, Net, MongoDB 등을 직접 빌드해야 한다. 10 | - Util 등의 라이브러리 디렉토리에 VS 버전, 32 or 64 플랫폼별 VS 프로젝트 파일이 있다. 11 | - 모두 빌드가 완료되면 lib64 디렉토리에 만들어져 있다. 12 | - VS2015, static mt, debug/release, x64 로 빌드 13 | - buildwin.cmd 140 rebuild static_mt both x64 14 | - VS2015, static md, debug/release, x64 로 빌드 15 | - buildwin.cmd 140 rebuild static_md both x64 16 | - OpenSSL 빌드 17 | - openssl-1.0.2을 플랫폼 별로 빌드한다. D:/Libraries/openssl-1.0.2-x86 と D:/Libraries/openssl-1.0.2-x64 18 | - components 파일을 열어서 OpenSSL 관련 디렉토리를 위의 디렉토리로 변경한다. set OPENSSL_DIR=D:\Libraries\openssl-1.0.2-x64 19 | - 생성된 lib 파일과 헤더 파일 디렉토리로 VS 프로젝트 설정에 등록한다. 20 | 21 | 22 | 23 | 24 |
25 |
26 |
27 |
28 | 29 | 30 | ## Linux 31 | 32 | 공식 사이트에서 최신 버전을 다운로드 한다. 33 | 압축을 풀고, 빌드한다. 34 | 35 | 아래는 64비트, static 라이브러리, 테스트와 샘플은 제외 하는 설정으로 빌드 한다 36 |
37 | $ tar zxvf poco-1.7.8p2-all.tar.gz
38 | $ cd poco-1.7.8p2-all/
39 |  
40 | $ export OSARCH_64BITS=1
41 | $ ./configure --static --no-tests --no-samples
42 | $ make
43 | 
44 | 45 | 설정 정보는 아래 처럼 더 추가할 수 있다. 46 |
47 | ./configure --omit=Data/ODBC,Data/SQLite --prefix=/usr --cflags=-fPIC --cflags=-std=c++11 --static --shared  --no-tests --no-samples
48 | 
49 | 50 | 빌드가 끝나면 아래 디렉토리에 라이브러리가 만들어져 있다. 51 |
52 | lib/Linux/x86_64
53 | 
54 | 55 | 디버그 버전은 라이브러리 이름 뒤에 'd'가 붙고, 64비트 버전은 뒤에 '64'가 붙는다. 56 | 57 | 58 | ### 샘플 예제 59 | sample.cpp 60 | ``` 61 | #include 62 | #include 63 | 64 | int main() { 65 | Poco::RegularExpression regexp("^[a-zA-Z]+"); 66 | 67 | std::string buf; 68 | regexp.extract("ABC123", buf); 69 | std::cout << buf << std::endl; //=> ABC 70 | 71 | return 0; 72 | } 73 | ``` 74 | 75 | Makefile 76 | ``` 77 | CXX=g++ 78 | CXXFLAGS=-I/mnt/e/linux/dev/c++/thirdparty/poco/Foundation/include 79 | LDFLAGS=-L/mnt/e/linux/dev/c++/thirdparty/poco/lib/Linux/x86_64 80 | LDLIBS=-lPocoFoundation64 81 | 82 | all:sample 83 | 84 | clean: 85 | rm -rf sample 86 | rm -rf *.o 87 | ``` 88 | 89 |
90 |
91 | 92 | ### 예제 돌려보기 93 | 94 | http://knoow.tistory.com/74 95 | http://scriptlabo.blog26.fc2.com/blog-entry-35.html 96 | https://www.qoosky.io/techs/8e92d3d34a 97 | 98 | -------------------------------------------------------------------------------- /resource/PocoVCInclude.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/resource/PocoVCInclude.png -------------------------------------------------------------------------------- /resource/PocoVCLib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacking75/examples_Cpp_Poco/c483e846686dcea67ad49ab7eea13ac1010ac321/resource/PocoVCLib.png --------------------------------------------------------------------------------