• R/O
  • SSH

hyakutyping: コミット

ゲーム用のソースコード


コミットメタ情報

リビジョンea1a3e6caa297c7e12d90ca20ee2c94cf20f70f3 (tree)
日時2011-01-13 03:05:27
作者Satofumi KAMIMURA
コミッターSatofumi KAMIMURA

ログメッセージ

ネットワーク機能を削除

変更サマリ

  • modified: Makefile (diff)
  • modified: config.txt (diff)
  • modified: hyakutyping.cpp (diff)
  • modified: luabindTyping.cpp (diff)
  • delete: TypingDatabase.cpp
  • delete: TypingDatabase.h
  • delete: all_test.cpp
  • delete: authentication.cpp
  • delete: authentication.h
  • delete: authentication_test.cpp
  • delete: authentication_test.h
  • delete: network_handler_test.lua
  • delete: pc_server.cpp
  • delete: qt_pc_server/DataServer.cpp
  • delete: qt_pc_server/DataServer.h
  • delete: qt_pc_server/DatabaseHandler.cpp
  • delete: qt_pc_server/DatabaseHandler.h
  • delete: qt_pc_server/Doxyfile
  • delete: qt_pc_server/MainWindowForm.ui
  • delete: qt_pc_server/ResponseThread.cpp
  • delete: qt_pc_server/ResponseThread.h
  • delete: qt_pc_server/ServerMainWindow.cpp
  • delete: qt_pc_server/ServerMainWindow.h
  • delete: qt_pc_server/dox/Makefile
  • delete: qt_pc_server/dox/battle.dox
  • delete: qt_pc_server/dox/database.dox
  • delete: qt_pc_server/dox/mainpage.dox
  • delete: qt_pc_server/dox/protocol.dox
  • delete: qt_pc_server/main.cpp
  • delete: qt_pc_server/moc_NetworkResponse.cpp
  • delete: qt_pc_server/pc_server.pro
  • delete: qt_pc_server/pc_server_ja.qm
  • delete: qt_pc_server/pc_server_ja.ts
  • delete: qt_pc_server/samples/Makefile
  • delete: qt_pc_server/samples/sqlite_sample/sqlite_sample.cpp
  • delete: qt_pc_server/samples/sqlite_sample/sqlite_sample.pro
  • delete: qt_pc_server/samples/tcpip_server_sample/EchobackServer.cpp
  • delete: qt_pc_server/samples/tcpip_server_sample/EchobackServer.h
  • delete: qt_pc_server/samples/tcpip_server_sample/tcpip_server_sample.cpp
  • delete: qt_pc_server/samples/tcpip_server_sample/tcpip_server_sample.pro
  • delete: qt_pc_server/server_data.sqlite3
  • delete: register_typing_data_test.cpp
  • delete: sha1.cpp
  • delete: sha1.h

差分

diff -r 47f83febdec5 -r ea1a3e6caa29 Makefile
--- a/Makefile Wed Jan 12 12:37:04 2011 +0900
+++ b/Makefile Thu Jan 13 03:05:27 2011 +0900
@@ -19,22 +19,17 @@
1919 # Target
2020 TARGET = \
2121 hyakutyping \
22- pc_server \
23- register_typing_data_test \
2422
2523 SCRIPTS = scripts/startup.lua scripts/first_menu.lua scripts/tear_down.lua scripts/shimonoku_typing.lua scripts/practice_menu.lua scripts/option_config.lua scripts/kimariji_typing.lua scripts/recent_history.lua scripts/display_result_practice.lua scripts/back_practice_menu.lua
2624 IGNORE_SCRIPTS = scripts/display_subtitle.lua scripts/wait_enter.lua
2725 HTML_PAGE = output_dox/index.html
2826
2927 all : $(TARGET) scripts/waka_data.lua lua_check
30-# cd qt_pc_server/ && qmake && $(MAKE)
3128
3229 png : flow.png
3330
3431 clean :
35- cd qt_pc_server/ && (if test -f Makefile; then $(MAKE) distclean; fi)
36- cd qt_pc_server/samples/ && $(MAKE) clean
37- $(RM) *.o $(TARGET) error_log.txt flow.dot all_test
32+ $(RM) *.o $(TARGET) error_log.txt flow.dot
3833 cd output_dox/ && $(RM) -rf *
3934 cd package/ && $(MAKE) clean
4035
@@ -42,9 +37,6 @@
4237 $(RM) savedata/local.sqlite3
4338 $(RM) savedata/option_saved.lua
4439
45-test : all_test
46- ./all_test
47-
4840 lua_check : $(wildcard scripts/*.lua)
4941 @luac -p $?
5042
@@ -65,22 +57,13 @@
6557 .dot.png :
6658 -dot -Tpng $< > $@
6759
68-register_typing_data_test : $(LIB_DIR)/connection/sdl/connection_sdl.a $(LIB_DIR)/system/sdl/system_sdl.a
69-
70-OBJS = luabindTyping.o HistoryGraph.o authentication.o sha1.o
71-REQUIRE_LIBS = $(LIB_DIR)/lua/lua.a $(LIB_DIR)/lua/lua_luabind.a $(LIB_DIR)/gui/gui.a $(LIB_DIR)/input/input.a $(LIB_DIR)/geometry/geometry.a $(LIB_DIR)/connection/connection.a $(LIB_DIR)/connection/sdl/connection_sdl.a $(LIB_DIR)/system/sdl/system_sdl.a $(LIB_DIR)/system/system.a
60+OBJS = luabindTyping.o HistoryGraph.o
61+REQUIRE_LIBS = $(LIB_DIR)/lua/lua.a $(LIB_DIR)/lua/lua_luabind.a $(LIB_DIR)/gui/gui.a $(LIB_DIR)/input/input.a $(LIB_DIR)/geometry/geometry.a $(LIB_DIR)/system/sdl/system_sdl.a $(LIB_DIR)/system/system.a
7262 $(REQUIRE_LIBS) :
7363 cd $(@D)/ && $(MAKE) $(@F)
7464
7565 hyakutyping : $(OBJS) $(REQUIRE_LIBS)
7666
77-pc_server : pc_server.o TypingDatabase.o response_thread.o authentication.o sha1.o $(LIB_DIR)/connection/sdl/connection_sdl.a $(LIB_DIR)/system/system.a $(LIB_DIR)/system/sdl/system_sdl.a
78- $(CXX) $(LDFLAGS) $(LDLIBS) -lsqlite3 -o $@ $^
79-
80-TEST_LDLIBS = `cppunit-config --libs`
81-all_test : all_test.o authentication_test.o authentication.o sha1.o
82- $(CXX) $(TEST_LDLIBS) $(TEST_LDFLAGS) $^ -o $@
83-
8467 scripts/waka_data.lua : waka_data.txt waka_converter.py
8568 python waka_converter.py waka_data.txt > $@
8669
@@ -99,32 +82,18 @@
9982 HistoryGraph.o: ../../../libs/gui/CanvasSurface.h ../../../libs/gui/Surface.h
10083 HistoryGraph.o: ../../../libs/common/Color.h ../../../libs/gui/TextSurface.h
10184 HistoryGraph.o: ../../../libs/gui/Font.h
102-TypingDatabase.o: TypingDatabase.h ../../../libs/system/fileExist.h
103-TypingDatabase.o: ../../../libs/system/Lock.h
104-TypingDatabase.o: ../../../libs/system/ConditionVariable.h
105-authentication.o: authentication.h hyakutyping.h sha1.h
106-authentication_test.o: authentication_test.h authentication.h hyakutyping.h
10785 hyakutyping.o: hyakutyping.h luabindTyping.h
10886 hyakutyping.o: ../../../libs/lua/lua_runStateMachine.h
10987 hyakutyping.o: ../../../libs/lua/luabindInit.h ../../../libs/lua/luabindGui.h
11088 hyakutyping.o: ../../../libs/lua/luabindGeometry.h
11189 hyakutyping.o: ../../../libs/lua/luabindCommon.h
11290 hyakutyping.o: ../../../libs/lua/luabindInput.h
113-hyakutyping.o: ../../../libs/lua/luabindNetwork.h
11491 hyakutyping.o: ../../../libs/lua/luabindSystem.h
11592 hyakutyping.o: ../../../libs/lua/LuaHandler.h ../../../libs/gui/Screen.h
11693 hyakutyping.o: ../../../libs/geometry/Rect.h ../../../libs/system/fileExist.h
117-luabindTyping.o: luabindTyping.h hyakutyping.h authentication.h
118-luabindTyping.o: HistoryGraph.h ../../../libs/gui/Component.h
119-luabindTyping.o: ../../../libs/geometry/Rect.h ../../../libs/geometry/Point.h
120-luabindTyping.o: ../../../libs/common/Color.h ../../../libs/gui/Font.h
121-luabindTyping.o: ../../../libs/lua/LuaHandler.h
122-pc_server.o: hyakutyping.h TypingDatabase.h response_thread.h
123-pc_server.o: ../../../libs/connection/TcpipAccepter.h
124-pc_server.o: ../../../libs/system/Thread.h ../../../libs/system/delay.h
125-pc_server.o: ../../../libs/system/log_printf.h
126-register_typing_data_test.o: ../../../libs/connection/TcpipSocket.h
127-register_typing_data_test.o: ../../../libs/connection/Connection.h
94+luabindTyping.o: luabindTyping.h hyakutyping.h HistoryGraph.h
95+luabindTyping.o: ../../../libs/gui/Component.h ../../../libs/geometry/Rect.h
96+luabindTyping.o: ../../../libs/geometry/Point.h ../../../libs/common/Color.h
97+luabindTyping.o: ../../../libs/gui/Font.h ../../../libs/lua/LuaHandler.h
12898 response_thread.o: response_thread.h ../../../libs/connection/TcpipSocket.h
12999 response_thread.o: ../../../libs/connection/Connection.h
130-sha1.o: sha1.h
diff -r 47f83febdec5 -r ea1a3e6caa29 TypingDatabase.cpp
--- a/TypingDatabase.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
1-/*!
2- \file
3- \brief タイピングデータの管理
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-
9- \todo Database にアクセスする際は、適切に Lock するようにする
10-*/
11-
12-#include "TypingDatabase.h"
13-#include "fileExist.h"
14-#include "Lock.h"
15-#include <sqlite3.h>
16-#include <string>
17-
18-using namespace qrk;
19-using namespace std;
20-
21-
22-namespace
23-{
24- const char DatabaseName[] = "server_data.sqlite3";
25-}
26-
27-
28-struct TypingDatabase::pImpl
29-{
30- string error_message_;
31- Lock mutex_;
32-
33- sqlite3* db_;
34-
35-
36- pImpl(void) : error_message_("no error."), db_(NULL)
37- {
38- }
39-
40-
41- static pImpl* singleton(void)
42- {
43- static pImpl singleton_object;
44- return &singleton_object;
45- }
46-
47-
48- bool initialize(void)
49- {
50- // データベースを作成し、テーブルを初期化する
51- // !!!
52-
53- return false;
54- }
55-};
56-
57-
58-TypingDatabase::TypingDatabase(void) : pimpl(pImpl::singleton())
59-{
60-}
61-
62-
63-TypingDatabase::~TypingDatabase(void)
64-{
65-}
66-
67-
68-const char* TypingDatabase::what(void) const
69-{
70- return pimpl->error_message_.c_str();
71-}
72-
73-
74-bool TypingDatabase::open(void)
75-{
76- // データベースが存在しなければ、作成して初期化する
77- if (! fileExist(DatabaseName)) {
78- return pimpl->initialize();
79- }
80-
81- // 接続できることを確認する
82- int ret = sqlite3_open(DatabaseName, &pimpl->db_);
83- if (ret != SQLITE_OK) {
84- // !!!
85- // error_message_ = "";
86- return false;
87- }
88-
89- // 接続は閉じておく
90- // !!!
91-
92- return false;
93-}
diff -r 47f83febdec5 -r ea1a3e6caa29 TypingDatabase.h
--- a/TypingDatabase.h Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
1-#ifndef TYPING_DATABASE_H
2-#define TYPING_DATABASE_H
3-
4-/*!
5- \file
6- \brief タイピングデータの管理
7-
8- \author Satofumi KAMIMURA
9-
10- $Id$
11-*/
12-
13-
14-class TypingDatabase
15-{
16-public:
17- TypingDatabase(void);
18- ~TypingDatabase(void);
19-
20- const char* what(void) const;
21-
22- bool open(void);
23- // !!! アカウント作成
24- // !!! 認証コードを取得
25- // !!! タイピングデータを登録
26-
27-private:
28- TypingDatabase(const TypingDatabase& rhs);
29- TypingDatabase& operator = (TypingDatabase& rhs);
30-
31- struct pImpl;
32- pImpl* pimpl;
33-};
34-
35-#endif /* !TYPING_DATABASE_H */
diff -r 47f83febdec5 -r ea1a3e6caa29 all_test.cpp
--- a/all_test.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
1-#include <string>
2-#include <cppunit/TestResult.h>
3-#include <cppunit/TestResultCollector.h>
4-#include <cppunit/TextTestProgressListener.h>
5-#include <cppunit/BriefTestProgressListener.h>
6-#include <cppunit/ui/text/TestRunner.h>
7-#include <cppunit/CompilerOutputter.h>
8-#include <cppunit/extensions/HelperMacros.h>
9-#include <stdexcept>
10-#include <iostream>
11-
12-using namespace std;
13-
14-
15-int main(int argc, char *argv[])
16-{
17- static_cast<void>(argc);
18- static_cast<void>(argv);
19-
20- CPPUNIT_NS::TestResult controller;
21-
22- CPPUNIT_NS::TestResultCollector result;
23- controller.addListener(&result);
24-
25- //CPPUNIT_NS::TextTestProgressListener progress;
26- CPPUNIT_NS::BriefTestProgressListener progress;
27- controller.addListener(&progress);
28-
29- CPPUNIT_NS::TestRunner runner;
30- runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
31-
32- runner.run(controller, "");
33-
34- CPPUNIT_NS::CompilerOutputter outputter(&result, cerr);
35- outputter.write();
36-
37-#if defined(_MSC_VER)
38- getchar();
39-#endif
40- return result.wasSuccessful() ? 0 : 1;
41-}
diff -r 47f83febdec5 -r ea1a3e6caa29 authentication.cpp
--- a/authentication.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
1-/*!
2- \file
3- \brief 認証の処理
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-*/
9-
10-#include "authentication.h"
11-#include "hyakutyping.h"
12-#include "sha1.h"
13-#include <cstdlib>
14-
15-using namespace std;
16-
17-
18-namespace
19-{
20- enum {
21- DecodedCodeByte = KeyCodeBitLength / 8, //!< binary 表現
22- EncodedCodeByte = KeyCodeBitLength / 4, //!< 16進文字列表現
23- };
24-
25-
26- // 16進文字列を bit 列に変換する
27- void bit_decode(unsigned char bits[], const string& code)
28- {
29- for (int i = 0; i < DecodedCodeByte; ++i) {
30- char buffer[] = "00";
31- buffer[0] = code[2 * i];
32- buffer[1] = code[(2 * i) + 1];
33- bits[i] = strtol(buffer, NULL, 16);
34- }
35- }
36-}
37-
38-
39-std::string generate_random_code(void)
40-{
41- string code = "";
42-
43- const char pattern[] = "0123456789abcdef";
44- for (size_t i = 0; i < EncodedCodeByte; ++i) {
45- int index = static_cast<int>(16.0 * random() / RAND_MAX);
46- code += pattern[index];
47- }
48- return code;
49-}
50-
51-
52-std::string xor_sha1_code(const std::string& send_code,
53- const std::string& authentication_code)
54-{
55- // 32 x 4 bit (128 bite) のデータとみなして処理する
56- unsigned char bits_a[DecodedCodeByte];
57- unsigned char bits_b[DecodedCodeByte];
58- bit_decode(bits_a, send_code);
59- bit_decode(bits_b, authentication_code);
60-
61- unsigned char xor_result[DecodedCodeByte];
62- for (int i = 0; i < EncodedCodeByte; ++i) {
63- xor_result[i] = bits_a[i] ^ bits_b[i];
64- }
65-
66- // sha1 を計算して、その文字列を返す
67- enum { SHA1_Size = 20 };
68- sha1_context ctx;
69- char sha1sum[SHA1_Size];
70- sha1_starts(&ctx);
71- sha1_update(&ctx, (uint8 *)xor_result, DecodedCodeByte);
72- sha1_finish(&ctx, (uint8 *)sha1sum);
73-
74- enum { SHA1_DecodedSize = SHA1_Size * 2 };
75- char decoded_sha1sum[SHA1_DecodedSize + 1];
76- for (int i = 0; i < SHA1_Size; ++i) {
77- snprintf(&decoded_sha1sum[2 * i], 2 + 1,
78- "%02x", static_cast<unsigned char>(sha1sum[i]));
79- }
80-
81- return decoded_sha1sum;
82-}
diff -r 47f83febdec5 -r ea1a3e6caa29 authentication.h
--- a/authentication.h Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
1-#ifndef AUTHENTICATION_H
2-#define AUTHENTICATION_H
3-
4-/*!
5- \file
6- \brief 認証の処理
7-
8- \author Satofumi KAMIMURA
9-
10- $Id$
11-*/
12-
13-#include <string>
14-
15-
16-//! 認証用のコードを生成する
17-extern std::string generate_random_code(void);
18-
19-
20-//! 認証用のコードに対して XOR 演算した結果に sha1 処理を適用する
21-extern std::string xor_sha1_code(const std::string& send_code,
22- const std::string& authentication_code);
23-
24-#endif /* !AUTHENTICATION_H */
diff -r 47f83febdec5 -r ea1a3e6caa29 authentication_test.cpp
--- a/authentication_test.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
1-/*!
2- \file
3- \brief authentication.c のテスト
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-*/
9-
10-#include "authentication_test.h"
11-#include "authentication.h"
12-#include "hyakutyping.h"
13-
14-using namespace std;
15-
16-
17-CPPUNIT_TEST_SUITE_REGISTRATION(authentication_test);
18-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(authentication_test,
19- "authentication_test");
20-
21-
22-void authentication_test::generate_random_code_test(void)
23-{
24- // 長さのテスト
25- string code = generate_random_code();
26- size_t code_size = code.size();
27- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(KeyCodeBitLength / 4), code_size);
28-
29- // 16 進数以外の文字が混入していないかのテスト
30- CPPUNIT_ASSERT_EQUAL(string::npos,
31- code.find_first_not_of("0123456789abcdef"));
32-}
33-
34-
35-void authentication_test::xor_sha1_code(void)
36-{
37- // テスト方法が思い浮かばないため、テストしない
38- // !!!
39-
40- CPPUNIT_FAIL("Not implemented.");
41-}
diff -r 47f83febdec5 -r ea1a3e6caa29 authentication_test.h
--- a/authentication_test.h Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
1-#ifndef AUTHENTICATION_TEST_H
2-#define AUTHENTICATION_TEST_H
3-
4-/*!
5- \file
6- \brief authentication.c のテスト
7-
8- \author Satofumi KAMIMURA
9-
10- $Id$
11-*/
12-
13-#include <cppunit/extensions/HelperMacros.h>
14-
15-
16-//! authentication.c のテストクラス
17-class authentication_test : public CppUnit::TestFixture
18-{
19- CPPUNIT_TEST_SUITE(authentication_test);
20- CPPUNIT_TEST(generate_random_code_test);
21- //CPPUNIT_TEST(xor_sha1_code);
22- CPPUNIT_TEST_SUITE_END();
23-
24-public:
25- void generate_random_code_test(void);
26- void xor_sha1_code(void);
27-};
28-
29-#endif /* !AUTHENTICATION_TEST_H */
diff -r 47f83febdec5 -r ea1a3e6caa29 config.txt
--- a/config.txt Wed Jan 12 12:37:04 2011 +0900
+++ b/config.txt Thu Jan 13 03:05:27 2011 +0900
@@ -1,2 +1,1 @@
11 # hyakutyping 用設定ファイル
2-server localhost:57577
diff -r 47f83febdec5 -r ea1a3e6caa29 hyakutyping.cpp
--- a/hyakutyping.cpp Wed Jan 12 12:37:04 2011 +0900
+++ b/hyakutyping.cpp Thu Jan 13 03:05:27 2011 +0900
@@ -15,7 +15,6 @@
1515 #include "luabindGeometry.h"
1616 #include "luabindCommon.h"
1717 #include "luabindInput.h"
18-#include "luabindNetwork.h"
1918 #include "luabindSystem.h"
2019 #include "LuaHandler.h"
2120 #include "Screen.h"
@@ -130,7 +129,6 @@
130129
131130 luabindSystem(L);
132131 luabindCommon(L);
133- luabindNetwork(L);
134132 luabindInput(L);
135133 luabindGeometry(L);
136134 luabindGui(L);
diff -r 47f83febdec5 -r ea1a3e6caa29 luabindTyping.cpp
--- a/luabindTyping.cpp Wed Jan 12 12:37:04 2011 +0900
+++ b/luabindTyping.cpp Thu Jan 13 03:05:27 2011 +0900
@@ -9,7 +9,6 @@
99
1010 #include "luabindTyping.h"
1111 #include "hyakutyping.h"
12-#include "authentication.h"
1312 #include "HistoryGraph.h"
1413 #include "Color.h"
1514 #include "Font.h"
@@ -35,12 +34,6 @@
3534 .def("setFont", &HistoryGraph::setFont)
3635 .def("setBackgroundColor", &HistoryGraph::setBackgroundColor)
3736 .def("addData", &HistoryGraph::addData)
38- .def("create", &HistoryGraph::create),
39-
40- def("xor_sha1_code", &xor_sha1_code)
37+ .def("create", &HistoryGraph::create)
4138 ];
42-
43- LuaHandler::registerValue(L, "ServerPort", ServerPort);
44- LuaHandler::registerValue(L, "AccountLength", AccountLength);
45- LuaHandler::registerValue(L, "KeyCodeBitLength", KeyCodeBitLength);
4639 }
diff -r 47f83febdec5 -r ea1a3e6caa29 network_handler_test.lua
--- a/network_handler_test.lua Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
1--- network_handler.lua のテスト
2---
3--- Satofumi KAMIMURA
4--- $Id$
5-
6-package.path = "scripts/?.lua"
7-require("network_handler")
8-
9-
10--- サーバ設定の読み出し
11-local server_name = network_handler_server()
12-if server_name == nil then
13- server_name = "nil"
14-end
15-print("server name: " .. server_name)
16-
17-
18--- キー・ファイルの取得
19-local account, key = network_handler_account()
20-if account == nil or key == nil then
21- account, key = "nil", "nil"
22-end
23-print("account: " .. account .. ", " .. key)
diff -r 47f83febdec5 -r ea1a3e6caa29 pc_server.cpp
--- a/pc_server.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
1-/*!
2- \file
3- \brief 「おぼえる、百人一首」用のデータサーバ
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-*/
9-
10-#include "hyakutyping.h"
11-#include "TypingDatabase.h"
12-#include "response_thread.h"
13-#include "TcpipAccepter.h"
14-#include "Thread.h"
15-#include "delay.h"
16-#include "log_printf.h"
17-#include <vector>
18-
19-using namespace qrk;
20-using namespace std;
21-
22-
23-int main(int argc, char *argv[])
24-{
25- static_cast<void>(argc);
26- static_cast<void>(argv);
27-
28- log_setName("pc_server_log.txt");
29-
30- // データベースの初期化
31- TypingDatabase database;
32- if (! database.open()) {
33- log_printf("TypingDatabase: %s\n", database.what());
34- return 1;
35- }
36-
37- // サーバポートの初期化
38- TcpipAccepter server;
39- if (! server.activate(ServerPort)) {
40- log_printf("TcpipAccepter: %s\n", server.what());
41- return 1;
42- }
43-
44- // クライアントに対する応答処理
45- vector<Thread*> client_threads;
46- while (true) {
47- TcpipSocket* client = server.accept();
48- if (client) {
49- // スレッドを作成して、クライアントへの応答を返す
50- Thread* thread = new Thread(response_thread, client);
51- client_threads.push_back(thread);
52- }
53-
54- // 応答が終了したスレッドを破棄
55- for (vector<Thread*>::iterator it = client_threads.begin();
56- it != client_threads.end(); ++it) {
57- if (! (*it)->isRunning()) {
58- delete *it;
59- *it = client_threads.back();
60- client_threads.pop_back();
61- --it;
62- }
63- }
64-
65- enum { ConnectPollingMsec = 100 };
66- delay(ConnectPollingMsec);
67- }
68-}
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/DataServer.cpp
--- a/qt_pc_server/DataServer.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
1-/*!
2- \file
3- \brief データ処理サーバ
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-*/
9-
10-#include "DataServer.h"
11-#include "ResponseThread.h"
12-
13-
14-#if 0
15-struct DataServer::pImpl
16-{
17-};
18-#endif
19-
20-
21-DataServer::DataServer(QObject *parent) : QTcpServer(parent)
22-{
23-}
24-
25-
26-#if 0
27-DataServer::~DataServer(void)
28-{
29-}
30-#endif
31-
32-
33-void DataServer::incomingConnection(int socket_descriptor)
34-{
35- ResponseThread *thread = new ResponseThread(socket_descriptor, this);
36- connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
37- thread->start();
38-}
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/DataServer.h
--- a/qt_pc_server/DataServer.h Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
1-#ifndef DATA_SERVER_H
2-#define DATA_SERVER_H
3-
4-/*!
5- \file
6- \brief データ処理サーバ
7-
8- \author Satofumi KAMIMURA
9-
10- $Id$
11-*/
12-
13-#include <QTcpServer>
14-//#include <memory>
15-
16-
17-class DataServer : public QTcpServer
18-{
19- Q_OBJECT;
20-
21-public:
22- DataServer(QObject *parent = 0);
23- //~DataServer(void);
24-
25-protected:
26- void incomingConnection(int socketDescriptor);
27-
28-private:
29- // !!!
30-
31- //struct pImpl;
32- //std::auto_ptr<pImpl> pimpl;
33-};
34-
35-#endif /* !DATA_SERVER_H */
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/DatabaseHandler.cpp
--- a/qt_pc_server/DatabaseHandler.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
1-/*!
2- \file
3- \brief データベース処理
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-*/
9-
10-#include "hyakutyping.h"
11-#include "DatabaseHandler.h"
12-#include "LockGuard.h"
13-#include "Lock.h"
14-#include <QSqlDatabase>
15-#include <QSqlQuery>
16-#include <QSqlError>
17-#include <QVariant>
18-#include <QFile>
19-#include <cassert>
20-
21-using namespace qrk;
22-using namespace std;
23-
24-
25-namespace
26-{
27- const char* DatabaseName = "server_data.sqlite3";
28-}
29-
30-
31-struct DatabaseHandler::pImpl
32-{
33- string error_message_;
34- Lock mutex_;
35- bool is_valid_;
36- QSqlDatabase db_;
37-
38-
39- pImpl(void)
40- : error_message_("no error."), is_valid_(false),
41- db_(QSqlDatabase::addDatabase("QSQLITE"))
42- {
43- QFile file(DatabaseName);
44-
45- // QSqlDatabase::opeN() は存在してなかった場合の新規作成を行う
46- // そのため、データベースが存在していなかったことを取得しておいて
47- // open() 後にテーブル等の初期化を行う
48- bool need_initialize = !file.exists();
49-
50- // データベースに接続する
51- db_.setDatabaseName(DatabaseName);
52- is_valid_ = db_.open();
53- if (!is_valid_) {
54- updateErrorMessage();
55- return;
56- }
57-
58- if (need_initialize) {
59- initializeDatabase();
60- }
61- }
62-
63-
64- static pImpl* object(void)
65- {
66- static pImpl singleton_object;
67- return &singleton_object;
68- }
69-
70-
71- void updateErrorMessage(void)
72- {
73- QSqlError error = db_.lastError();
74- error_message_ = error.text().toStdString();
75- }
76-
77-
78- void initializeDatabase(void)
79- {
80- // テーブルの作成
81- string table_query[] = {
82- "CREATE TABLE user_account (user_id, key_code, first_access, last_access, is_active, handle)",
83- "CREATE TABLE authentication_log (user_id, first_access, authentication_code)",
84- // !!!
85- };
86-
87- size_t n = sizeof(table_query) / sizeof(table_query[0]);
88- QSqlQuery query(db_);
89- for (size_t i = 0; i < n; ++i) {
90- query.exec(table_query[i].c_str());
91- }
92-
93- // 初期データの格納
94- // !!! あれば、追加する
95- // !!! その場合、上記のあたりを関数化して利用すること
96- }
97-};
98-
99-
100-DatabaseHandler::DatabaseHandler(void) : pimpl(pImpl::object())
101-{
102-}
103-
104-
105-DatabaseHandler::~DatabaseHandler(void)
106-{
107-}
108-
109-
110-void DatabaseHandler::terminate(void)
111-{
112- QSqlDatabase::removeDatabase("QSQLITE");
113-}
114-
115-
116-const char* DatabaseHandler::what(void) const
117-{
118- return pimpl->error_message_.c_str();
119-}
120-
121-
122-bool DatabaseHandler::isValid(void) const
123-{
124- return pimpl->is_valid_;
125-}
126-
127-
128-bool DatabaseHandler::createAccount(std::string& account,
129- const std::string& key_code)
130-{
131- LockGuard guard(pimpl->mutex_);
132-
133- // ユーザ ID の生成
134- // 現在の最大シリアル ID を取得し、インクリメントした数を使う
135- QSqlQuery query(pimpl->db_);
136- query.exec("SELECT max(user_id) FROM user_account");
137- long last_id = (query.next()) ? query.value(0).toInt() : 0;
138- enum { BufferSize = 13 };
139- char buffer[BufferSize];
140- snprintf(buffer, BufferSize, "%08ld", last_id + 1);
141- account = buffer;
142- assert(account.size() != AccountLength);
143-
144- // Database への登録
145- // 初期状態では無効にしておき、最初にデータが追加されたときに有効にする
146- // 最初のデータ登録かは、first_access, last_access が等しいかで判断する
147- QString insert_query("INSERT INTO user_account VALUES('%1', '%2', datetime('now'), datetime('now'), 0, 'guest')");
148- query.exec(insert_query.arg(account.c_str(), key_code.c_str()));
149-
150- return true;
151-}
152-
153-
154-bool DatabaseHandler::authenticationCode(std::string& authentication_code,
155- const std::string& user_id)
156-{
157- QString select_key_code("SELECT key_code FROM user_account WHERE user_id = '%1'");
158- QSqlQuery query(pimpl->db_);
159- query.exec(select_key_code.arg(user_id.c_str()));
160- if (! query.next()) {
161- return false;
162- }
163-
164- authentication_code = query.value(0).toString().toStdString();
165- return true;
166-}
167-
168-
169-bool DatabaseHandler::registerTypingData(const std::string& typing_data)
170-{
171- (void)typing_data;
172-
173- // first_access, last_access が等しければ、アカウントを有効にする
174- // !!! 2 つの now の値が同じになるのものなのかを確認すべき
175- // !!! または、差が 1 秒ならば同じとみなす
176-
177- // !!!
178-
179- return false;
180-}
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/DatabaseHandler.h
--- a/qt_pc_server/DatabaseHandler.h Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
1-#ifndef DATABASE_HANDLER_H
2-#define DATABASE_HANDLER_H
3-
4-/*!
5- \file
6- \brief データベース処理
7-
8- \author Satofumi KAMIMURA
9-
10- $Id$
11-*/
12-
13-#include <string>
14-
15-
16-//! データベース処理
17-class DatabaseHandler
18-{
19-public:
20- DatabaseHandler(void);
21- ~DatabaseHandler(void);
22-
23- static void terminate(void);
24-
25- const char* what(void) const;
26- bool isValid(void) const;
27-
28- bool createAccount(std::string& account, const std::string& key_code);
29- bool authenticationCode(std::string& authentication_code,
30- const std::string& user_ide);
31- bool registerTypingData(const std::string& typing_data);
32-
33-
34-private:
35- DatabaseHandler(const DatabaseHandler& rhs);
36- DatabaseHandler& operator = (const DatabaseHandler& rhs);
37-
38- struct pImpl;
39- pImpl* pimpl;
40-};
41-
42-#endif /* !DATABASE_HANDLER_H */
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/Doxyfile
--- a/qt_pc_server/Doxyfile Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1599 +0,0 @@
1-# Doxyfile 1.6.3-20100324
2-
3-# This file describes the settings to be used by the documentation system
4-# doxygen (www.doxygen.org) for a project
5-#
6-# All text after a hash (#) is considered a comment and will be ignored
7-# The format is:
8-# TAG = value [value, ...]
9-# For lists items can also be appended using:
10-# TAG += value [value, ...]
11-# Values that contain spaces should be placed between quotes (" ")
12-
13-#---------------------------------------------------------------------------
14-# Project related configuration options
15-#---------------------------------------------------------------------------
16-
17-# This tag specifies the encoding used for all characters in the config file
18-# that follow. The default is UTF-8 which is also the encoding used for all
19-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
20-# iconv built into libc) for the transcoding. See
21-# http://www.gnu.org/software/libiconv for the list of possible encodings.
22-
23-DOXYFILE_ENCODING = UTF-8
24-
25-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
26-# by quotes) that should identify the project.
27-
28-PROJECT_NAME =
29-
30-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
31-# This could be handy for archiving the generated documentation or
32-# if some version control system is used.
33-
34-PROJECT_NUMBER =
35-
36-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
37-# base path where the generated documentation will be put.
38-# If a relative path is entered, it will be relative to the location
39-# where doxygen was started. If left blank the current directory will be used.
40-
41-OUTPUT_DIRECTORY =
42-
43-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
44-# 4096 sub-directories (in 2 levels) under the output directory of each output
45-# format and will distribute the generated files over these directories.
46-# Enabling this option can be useful when feeding doxygen a huge amount of
47-# source files, where putting all generated files in the same directory would
48-# otherwise cause performance problems for the file system.
49-
50-CREATE_SUBDIRS = NO
51-
52-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
53-# documentation generated by doxygen is written. Doxygen will use this
54-# information to generate all constant output in the proper language.
55-# The default language is English, other supported languages are:
56-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
57-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
58-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
59-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
60-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
61-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
62-
63-OUTPUT_LANGUAGE = Japanese-en
64-
65-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
66-# include brief member descriptions after the members that are listed in
67-# the file and class documentation (similar to JavaDoc).
68-# Set to NO to disable this.
69-
70-BRIEF_MEMBER_DESC = YES
71-
72-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
73-# the brief description of a member or function before the detailed description.
74-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
75-# brief descriptions will be completely suppressed.
76-
77-REPEAT_BRIEF = YES
78-
79-# This tag implements a quasi-intelligent brief description abbreviator
80-# that is used to form the text in various listings. Each string
81-# in this list, if found as the leading text of the brief description, will be
82-# stripped from the text and the result after processing the whole list, is
83-# used as the annotated text. Otherwise, the brief description is used as-is.
84-# If left blank, the following values are used ("$name" is automatically
85-# replaced with the name of the entity): "The $name class" "The $name widget"
86-# "The $name file" "is" "provides" "specifies" "contains"
87-# "represents" "a" "an" "the"
88-
89-ABBREVIATE_BRIEF =
90-
91-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
92-# Doxygen will generate a detailed section even if there is only a brief
93-# description.
94-
95-ALWAYS_DETAILED_SEC = NO
96-
97-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
98-# inherited members of a class in the documentation of that class as if those
99-# members were ordinary class members. Constructors, destructors and assignment
100-# operators of the base classes will not be shown.
101-
102-INLINE_INHERITED_MEMB = NO
103-
104-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
105-# path before files name in the file list and in the header files. If set
106-# to NO the shortest path that makes the file name unique will be used.
107-
108-FULL_PATH_NAMES = YES
109-
110-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
111-# can be used to strip a user-defined part of the path. Stripping is
112-# only done if one of the specified strings matches the left-hand part of
113-# the path. The tag can be used to show relative paths in the file list.
114-# If left blank the directory from which doxygen is run is used as the
115-# path to strip.
116-
117-STRIP_FROM_PATH =
118-
119-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
120-# the path mentioned in the documentation of a class, which tells
121-# the reader which header file to include in order to use a class.
122-# If left blank only the name of the header file containing the class
123-# definition is used. Otherwise one should specify the include paths that
124-# are normally passed to the compiler using the -I flag.
125-
126-STRIP_FROM_INC_PATH =
127-
128-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
129-# (but less readable) file names. This can be useful is your file systems
130-# doesn't support long names like on DOS, Mac, or CD-ROM.
131-
132-SHORT_NAMES = NO
133-
134-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
135-# will interpret the first line (until the first dot) of a JavaDoc-style
136-# comment as the brief description. If set to NO, the JavaDoc
137-# comments will behave just like regular Qt-style comments
138-# (thus requiring an explicit @brief command for a brief description.)
139-
140-JAVADOC_AUTOBRIEF = NO
141-
142-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
143-# interpret the first line (until the first dot) of a Qt-style
144-# comment as the brief description. If set to NO, the comments
145-# will behave just like regular Qt-style comments (thus requiring
146-# an explicit \brief command for a brief description.)
147-
148-QT_AUTOBRIEF = NO
149-
150-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
151-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
152-# comments) as a brief description. This used to be the default behaviour.
153-# The new default is to treat a multi-line C++ comment block as a detailed
154-# description. Set this tag to YES if you prefer the old behaviour instead.
155-
156-MULTILINE_CPP_IS_BRIEF = NO
157-
158-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
159-# member inherits the documentation from any documented member that it
160-# re-implements.
161-
162-INHERIT_DOCS = YES
163-
164-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
165-# a new page for each member. If set to NO, the documentation of a member will
166-# be part of the file/class/namespace that contains it.
167-
168-SEPARATE_MEMBER_PAGES = NO
169-
170-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
171-# Doxygen uses this value to replace tabs by spaces in code fragments.
172-
173-TAB_SIZE = 8
174-
175-# This tag can be used to specify a number of aliases that acts
176-# as commands in the documentation. An alias has the form "name=value".
177-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
178-# put the command \sideeffect (or @sideeffect) in the documentation, which
179-# will result in a user-defined paragraph with heading "Side Effects:".
180-# You can put \n's in the value part of an alias to insert newlines.
181-
182-ALIASES =
183-
184-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
185-# sources only. Doxygen will then generate output that is more tailored for C.
186-# For instance, some of the names that are used will be different. The list
187-# of all members will be omitted, etc.
188-
189-OPTIMIZE_OUTPUT_FOR_C = NO
190-
191-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
192-# sources only. Doxygen will then generate output that is more tailored for
193-# Java. For instance, namespaces will be presented as packages, qualified
194-# scopes will look different, etc.
195-
196-OPTIMIZE_OUTPUT_JAVA = NO
197-
198-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
199-# sources only. Doxygen will then generate output that is more tailored for
200-# Fortran.
201-
202-OPTIMIZE_FOR_FORTRAN = NO
203-
204-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
205-# sources. Doxygen will then generate output that is tailored for
206-# VHDL.
207-
208-OPTIMIZE_OUTPUT_VHDL = NO
209-
210-# Doxygen selects the parser to use depending on the extension of the files it
211-# parses. With this tag you can assign which parser to use for a given extension.
212-# Doxygen has a built-in mapping, but you can override or extend it using this
213-# tag. The format is ext=language, where ext is a file extension, and language
214-# is one of the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++,
215-# D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
216-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
217-# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
218-# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
219-
220-EXTENSION_MAPPING =
221-
222-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
223-# to include (a tag file for) the STL sources as input, then you should
224-# set this tag to YES in order to let doxygen match functions declarations and
225-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
226-# func(std::string) {}). This also make the inheritance and collaboration
227-# diagrams that involve STL classes more complete and accurate.
228-
229-BUILTIN_STL_SUPPORT = NO
230-
231-# If you use Microsoft's C++/CLI language, you should set this option to YES to
232-# enable parsing support.
233-
234-CPP_CLI_SUPPORT = NO
235-
236-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
237-# Doxygen will parse them like normal C++ but will assume all classes use public
238-# instead of private inheritance when no explicit protection keyword is present.
239-
240-SIP_SUPPORT = NO
241-
242-# For Microsoft's IDL there are propget and propput attributes to indicate getter
243-# and setter methods for a property. Setting this option to YES (the default)
244-# will make doxygen to replace the get and set methods by a property in the
245-# documentation. This will only work if the methods are indeed getting or
246-# setting a simple type. If this is not the case, or you want to show the
247-# methods anyway, you should set this option to NO.
248-
249-IDL_PROPERTY_SUPPORT = YES
250-
251-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
252-# tag is set to YES, then doxygen will reuse the documentation of the first
253-# member in the group (if any) for the other members of the group. By default
254-# all members of a group must be documented explicitly.
255-
256-DISTRIBUTE_GROUP_DOC = NO
257-
258-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
259-# the same type (for instance a group of public functions) to be put as a
260-# subgroup of that type (e.g. under the Public Functions section). Set it to
261-# NO to prevent subgrouping. Alternatively, this can be done per class using
262-# the \nosubgrouping command.
263-
264-SUBGROUPING = YES
265-
266-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
267-# is documented as struct, union, or enum with the name of the typedef. So
268-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
269-# with name TypeT. When disabled the typedef will appear as a member of a file,
270-# namespace, or class. And the struct will be named TypeS. This can typically
271-# be useful for C code in case the coding convention dictates that all compound
272-# types are typedef'ed and only the typedef is referenced, never the tag name.
273-
274-TYPEDEF_HIDES_STRUCT = NO
275-
276-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
277-# determine which symbols to keep in memory and which to flush to disk.
278-# When the cache is full, less often used symbols will be written to disk.
279-# For small to medium size projects (<1000 input files) the default value is
280-# probably good enough. For larger projects a too small cache size can cause
281-# doxygen to be busy swapping symbols to and from disk most of the time
282-# causing a significant performance penality.
283-# If the system has enough physical memory increasing the cache will improve the
284-# performance by keeping more symbols in memory. Note that the value works on
285-# a logarithmic scale so increasing the size by one will rougly double the
286-# memory usage. The cache size is given by this formula:
287-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
288-# corresponding to a cache size of 2^16 = 65536 symbols
289-
290-SYMBOL_CACHE_SIZE = 0
291-
292-#---------------------------------------------------------------------------
293-# Build related configuration options
294-#---------------------------------------------------------------------------
295-
296-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
297-# documentation are documented, even if no documentation was available.
298-# Private class members and static file members will be hidden unless
299-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
300-
301-EXTRACT_ALL = NO
302-
303-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
304-# will be included in the documentation.
305-
306-EXTRACT_PRIVATE = NO
307-
308-# If the EXTRACT_STATIC tag is set to YES all static members of a file
309-# will be included in the documentation.
310-
311-EXTRACT_STATIC = NO
312-
313-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
314-# defined locally in source files will be included in the documentation.
315-# If set to NO only classes defined in header files are included.
316-
317-EXTRACT_LOCAL_CLASSES = NO
318-
319-# This flag is only useful for Objective-C code. When set to YES local
320-# methods, which are defined in the implementation section but not in
321-# the interface are included in the documentation.
322-# If set to NO (the default) only methods in the interface are included.
323-
324-EXTRACT_LOCAL_METHODS = NO
325-
326-# If this flag is set to YES, the members of anonymous namespaces will be
327-# extracted and appear in the documentation as a namespace called
328-# 'anonymous_namespace{file}', where file will be replaced with the base
329-# name of the file that contains the anonymous namespace. By default
330-# anonymous namespace are hidden.
331-
332-EXTRACT_ANON_NSPACES = NO
333-
334-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
335-# undocumented members of documented classes, files or namespaces.
336-# If set to NO (the default) these members will be included in the
337-# various overviews, but no documentation section is generated.
338-# This option has no effect if EXTRACT_ALL is enabled.
339-
340-HIDE_UNDOC_MEMBERS = NO
341-
342-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
343-# undocumented classes that are normally visible in the class hierarchy.
344-# If set to NO (the default) these classes will be included in the various
345-# overviews. This option has no effect if EXTRACT_ALL is enabled.
346-
347-HIDE_UNDOC_CLASSES = NO
348-
349-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
350-# friend (class|struct|union) declarations.
351-# If set to NO (the default) these declarations will be included in the
352-# documentation.
353-
354-HIDE_FRIEND_COMPOUNDS = NO
355-
356-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
357-# documentation blocks found inside the body of a function.
358-# If set to NO (the default) these blocks will be appended to the
359-# function's detailed documentation block.
360-
361-HIDE_IN_BODY_DOCS = NO
362-
363-# The INTERNAL_DOCS tag determines if documentation
364-# that is typed after a \internal command is included. If the tag is set
365-# to NO (the default) then the documentation will be excluded.
366-# Set it to YES to include the internal documentation.
367-
368-INTERNAL_DOCS = NO
369-
370-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
371-# file names in lower-case letters. If set to YES upper-case letters are also
372-# allowed. This is useful if you have classes or files whose names only differ
373-# in case and if your file system supports case sensitive file names. Windows
374-# and Mac users are advised to set this option to NO.
375-
376-CASE_SENSE_NAMES = YES
377-
378-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
379-# will show members with their full class and namespace scopes in the
380-# documentation. If set to YES the scope will be hidden.
381-
382-HIDE_SCOPE_NAMES = NO
383-
384-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
385-# will put a list of the files that are included by a file in the documentation
386-# of that file.
387-
388-SHOW_INCLUDE_FILES = YES
389-
390-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
391-# will list include files with double quotes in the documentation
392-# rather than with sharp brackets.
393-
394-FORCE_LOCAL_INCLUDES = NO
395-
396-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
397-# is inserted in the documentation for inline members.
398-
399-INLINE_INFO = YES
400-
401-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
402-# will sort the (detailed) documentation of file and class members
403-# alphabetically by member name. If set to NO the members will appear in
404-# declaration order.
405-
406-SORT_MEMBER_DOCS = YES
407-
408-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
409-# brief documentation of file, namespace and class members alphabetically
410-# by member name. If set to NO (the default) the members will appear in
411-# declaration order.
412-
413-SORT_BRIEF_DOCS = NO
414-
415-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
416-# will sort the (brief and detailed) documentation of class members so that
417-# constructors and destructors are listed first. If set to NO (the default)
418-# the constructors will appear in the respective orders defined by
419-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
420-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
421-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
422-
423-SORT_MEMBERS_CTORS_1ST = NO
424-
425-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
426-# hierarchy of group names into alphabetical order. If set to NO (the default)
427-# the group names will appear in their defined order.
428-
429-SORT_GROUP_NAMES = NO
430-
431-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
432-# sorted by fully-qualified names, including namespaces. If set to
433-# NO (the default), the class list will be sorted only by class name,
434-# not including the namespace part.
435-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
436-# Note: This option applies only to the class list, not to the
437-# alphabetical list.
438-
439-SORT_BY_SCOPE_NAME = NO
440-
441-# The GENERATE_TODOLIST tag can be used to enable (YES) or
442-# disable (NO) the todo list. This list is created by putting \todo
443-# commands in the documentation.
444-
445-GENERATE_TODOLIST = YES
446-
447-# The GENERATE_TESTLIST tag can be used to enable (YES) or
448-# disable (NO) the test list. This list is created by putting \test
449-# commands in the documentation.
450-
451-GENERATE_TESTLIST = YES
452-
453-# The GENERATE_BUGLIST tag can be used to enable (YES) or
454-# disable (NO) the bug list. This list is created by putting \bug
455-# commands in the documentation.
456-
457-GENERATE_BUGLIST = YES
458-
459-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
460-# disable (NO) the deprecated list. This list is created by putting
461-# \deprecated commands in the documentation.
462-
463-GENERATE_DEPRECATEDLIST= YES
464-
465-# The ENABLED_SECTIONS tag can be used to enable conditional
466-# documentation sections, marked by \if sectionname ... \endif.
467-
468-ENABLED_SECTIONS =
469-
470-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
471-# the initial value of a variable or define consists of for it to appear in
472-# the documentation. If the initializer consists of more lines than specified
473-# here it will be hidden. Use a value of 0 to hide initializers completely.
474-# The appearance of the initializer of individual variables and defines in the
475-# documentation can be controlled using \showinitializer or \hideinitializer
476-# command in the documentation regardless of this setting.
477-
478-MAX_INITIALIZER_LINES = 30
479-
480-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
481-# at the bottom of the documentation of classes and structs. If set to YES the
482-# list will mention the files that were used to generate the documentation.
483-
484-SHOW_USED_FILES = YES
485-
486-# If the sources in your project are distributed over multiple directories
487-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
488-# in the documentation. The default is NO.
489-
490-SHOW_DIRECTORIES = NO
491-
492-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
493-# This will remove the Files entry from the Quick Index and from the
494-# Folder Tree View (if specified). The default is YES.
495-
496-SHOW_FILES = YES
497-
498-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
499-# Namespaces page.
500-# This will remove the Namespaces entry from the Quick Index
501-# and from the Folder Tree View (if specified). The default is YES.
502-
503-SHOW_NAMESPACES = YES
504-
505-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
506-# doxygen should invoke to get the current version for each file (typically from
507-# the version control system). Doxygen will invoke the program by executing (via
508-# popen()) the command <command> <input-file>, where <command> is the value of
509-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
510-# provided by doxygen. Whatever the program writes to standard output
511-# is used as the file version. See the manual for examples.
512-
513-FILE_VERSION_FILTER =
514-
515-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
516-# by doxygen. The layout file controls the global structure of the generated
517-# output files in an output format independent way. The create the layout file
518-# that represents doxygen's defaults, run doxygen with the -l option.
519-# You can optionally specify a file name after the option, if omitted
520-# DoxygenLayout.xml will be used as the name of the layout file.
521-
522-LAYOUT_FILE =
523-
524-#---------------------------------------------------------------------------
525-# configuration options related to warning and progress messages
526-#---------------------------------------------------------------------------
527-
528-# The QUIET tag can be used to turn on/off the messages that are generated
529-# by doxygen. Possible values are YES and NO. If left blank NO is used.
530-
531-QUIET = NO
532-
533-# The WARNINGS tag can be used to turn on/off the warning messages that are
534-# generated by doxygen. Possible values are YES and NO. If left blank
535-# NO is used.
536-
537-WARNINGS = YES
538-
539-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
540-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
541-# automatically be disabled.
542-
543-WARN_IF_UNDOCUMENTED = YES
544-
545-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
546-# potential errors in the documentation, such as not documenting some
547-# parameters in a documented function, or documenting parameters that
548-# don't exist or using markup commands wrongly.
549-
550-WARN_IF_DOC_ERROR = YES
551-
552-# This WARN_NO_PARAMDOC option can be abled to get warnings for
553-# functions that are documented, but have no documentation for their parameters
554-# or return value. If set to NO (the default) doxygen will only warn about
555-# wrong or incomplete parameter documentation, but not about the absence of
556-# documentation.
557-
558-WARN_NO_PARAMDOC = NO
559-
560-# The WARN_FORMAT tag determines the format of the warning messages that
561-# doxygen can produce. The string should contain the $file, $line, and $text
562-# tags, which will be replaced by the file and line number from which the
563-# warning originated and the warning text. Optionally the format may contain
564-# $version, which will be replaced by the version of the file (if it could
565-# be obtained via FILE_VERSION_FILTER)
566-
567-WARN_FORMAT = "$file:$line: $text"
568-
569-# The WARN_LOGFILE tag can be used to specify a file to which warning
570-# and error messages should be written. If left blank the output is written
571-# to stderr.
572-
573-WARN_LOGFILE =
574-
575-#---------------------------------------------------------------------------
576-# configuration options related to the input files
577-#---------------------------------------------------------------------------
578-
579-# The INPUT tag can be used to specify the files and/or directories that contain
580-# documented source files. You may enter file names like "myfile.cpp" or
581-# directories like "/usr/src/myproject". Separate the files or directories
582-# with spaces.
583-
584-INPUT = dox/ ./
585-
586-# This tag can be used to specify the character encoding of the source files
587-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
588-# also the default input encoding. Doxygen uses libiconv (or the iconv built
589-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
590-# the list of possible encodings.
591-
592-INPUT_ENCODING = UTF-8
593-
594-# If the value of the INPUT tag contains directories, you can use the
595-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
596-# and *.h) to filter out the source-files in the directories. If left
597-# blank the following patterns are tested:
598-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
599-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
600-
601-FILE_PATTERNS =
602-
603-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
604-# should be searched for input files as well. Possible values are YES and NO.
605-# If left blank NO is used.
606-
607-RECURSIVE = NO
608-
609-# The EXCLUDE tag can be used to specify files and/or directories that should
610-# excluded from the INPUT source files. This way you can easily exclude a
611-# subdirectory from a directory tree whose root is specified with the INPUT tag.
612-
613-EXCLUDE =
614-
615-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
616-# directories that are symbolic links (a Unix filesystem feature) are excluded
617-# from the input.
618-
619-EXCLUDE_SYMLINKS = NO
620-
621-# If the value of the INPUT tag contains directories, you can use the
622-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
623-# certain files from those directories. Note that the wildcards are matched
624-# against the file with absolute path, so to exclude all test directories
625-# for example use the pattern */test/*
626-
627-EXCLUDE_PATTERNS = ui_*
628-
629-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
630-# (namespaces, classes, functions, etc.) that should be excluded from the
631-# output. The symbol name can be a fully qualified name, a word, or if the
632-# wildcard * is used, a substring. Examples: ANamespace, AClass,
633-# AClass::ANamespace, ANamespace::*Test
634-
635-EXCLUDE_SYMBOLS =
636-
637-# The EXAMPLE_PATH tag can be used to specify one or more files or
638-# directories that contain example code fragments that are included (see
639-# the \include command).
640-
641-EXAMPLE_PATH =
642-
643-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
644-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
645-# and *.h) to filter out the source-files in the directories. If left
646-# blank all files are included.
647-
648-EXAMPLE_PATTERNS =
649-
650-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
651-# searched for input files to be used with the \include or \dontinclude
652-# commands irrespective of the value of the RECURSIVE tag.
653-# Possible values are YES and NO. If left blank NO is used.
654-
655-EXAMPLE_RECURSIVE = NO
656-
657-# The IMAGE_PATH tag can be used to specify one or more files or
658-# directories that contain image that are included in the documentation (see
659-# the \image command).
660-
661-IMAGE_PATH = dox/
662-
663-# The INPUT_FILTER tag can be used to specify a program that doxygen should
664-# invoke to filter for each input file. Doxygen will invoke the filter program
665-# by executing (via popen()) the command <filter> <input-file>, where <filter>
666-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
667-# input file. Doxygen will then use the output that the filter program writes
668-# to standard output.
669-# If FILTER_PATTERNS is specified, this tag will be
670-# ignored.
671-
672-INPUT_FILTER =
673-
674-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
675-# basis.
676-# Doxygen will compare the file name with each pattern and apply the
677-# filter if there is a match.
678-# The filters are a list of the form:
679-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
680-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
681-# is applied to all files.
682-
683-FILTER_PATTERNS =
684-
685-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
686-# INPUT_FILTER) will be used to filter the input files when producing source
687-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
688-
689-FILTER_SOURCE_FILES = NO
690-
691-#---------------------------------------------------------------------------
692-# configuration options related to source browsing
693-#---------------------------------------------------------------------------
694-
695-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
696-# be generated. Documented entities will be cross-referenced with these sources.
697-# Note: To get rid of all source code in the generated output, make sure also
698-# VERBATIM_HEADERS is set to NO.
699-
700-SOURCE_BROWSER = NO
701-
702-# Setting the INLINE_SOURCES tag to YES will include the body
703-# of functions and classes directly in the documentation.
704-
705-INLINE_SOURCES = NO
706-
707-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
708-# doxygen to hide any special comment blocks from generated source code
709-# fragments. Normal C and C++ comments will always remain visible.
710-
711-STRIP_CODE_COMMENTS = YES
712-
713-# If the REFERENCED_BY_RELATION tag is set to YES
714-# then for each documented function all documented
715-# functions referencing it will be listed.
716-
717-REFERENCED_BY_RELATION = NO
718-
719-# If the REFERENCES_RELATION tag is set to YES
720-# then for each documented function all documented entities
721-# called/used by that function will be listed.
722-
723-REFERENCES_RELATION = NO
724-
725-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
726-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
727-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
728-# link to the source code.
729-# Otherwise they will link to the documentation.
730-
731-REFERENCES_LINK_SOURCE = YES
732-
733-# If the USE_HTAGS tag is set to YES then the references to source code
734-# will point to the HTML generated by the htags(1) tool instead of doxygen
735-# built-in source browser. The htags tool is part of GNU's global source
736-# tagging system (see http://www.gnu.org/software/global/global.html). You
737-# will need version 4.8.6 or higher.
738-
739-USE_HTAGS = NO
740-
741-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
742-# will generate a verbatim copy of the header file for each class for
743-# which an include is specified. Set to NO to disable this.
744-
745-VERBATIM_HEADERS = YES
746-
747-#---------------------------------------------------------------------------
748-# configuration options related to the alphabetical class index
749-#---------------------------------------------------------------------------
750-
751-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
752-# of all compounds will be generated. Enable this if the project
753-# contains a lot of classes, structs, unions or interfaces.
754-
755-ALPHABETICAL_INDEX = NO
756-
757-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
758-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
759-# in which this list will be split (can be a number in the range [1..20])
760-
761-COLS_IN_ALPHA_INDEX = 5
762-
763-# In case all classes in a project start with a common prefix, all
764-# classes will be put under the same header in the alphabetical index.
765-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
766-# should be ignored while generating the index headers.
767-
768-IGNORE_PREFIX =
769-
770-#---------------------------------------------------------------------------
771-# configuration options related to the HTML output
772-#---------------------------------------------------------------------------
773-
774-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
775-# generate HTML output.
776-
777-GENERATE_HTML = YES
778-
779-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
780-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
781-# put in front of it. If left blank `html' will be used as the default path.
782-
783-HTML_OUTPUT = generated_html
784-
785-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
786-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
787-# doxygen will generate files with .html extension.
788-
789-HTML_FILE_EXTENSION = .html
790-
791-# The HTML_HEADER tag can be used to specify a personal HTML header for
792-# each generated HTML page. If it is left blank doxygen will generate a
793-# standard header.
794-
795-HTML_HEADER =
796-
797-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
798-# each generated HTML page. If it is left blank doxygen will generate a
799-# standard footer.
800-
801-HTML_FOOTER =
802-
803-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
804-# style sheet that is used by each HTML page. It can be used to
805-# fine-tune the look of the HTML output. If the tag is left blank doxygen
806-# will generate a default style sheet. Note that doxygen will try to copy
807-# the style sheet file to the HTML output directory, so don't put your own
808-# stylesheet in the HTML output directory as well, or it will be erased!
809-
810-HTML_STYLESHEET =
811-
812-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
813-# Doxygen will adjust the colors in the stylesheet and background images
814-# according to this color. Hue is specified as an angle on a colorwheel,
815-# see http://en.wikipedia.org/wiki/Hue for more information.
816-# For instance the value 0 represents red, 60 is yellow, 120 is green,
817-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
818-# The allowed range is 0 to 359.
819-
820-HTML_COLORSTYLE_HUE = 220
821-
822-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
823-# the colors in the HTML output. For a value of 0 the output will use
824-# grayscales only. A value of 255 will produce the most vivid colors.
825-
826-HTML_COLORSTYLE_SAT = 100
827-
828-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
829-# the luminance component of the colors in the HTML output. Values below
830-# 100 gradually make the output lighter, whereas values above 100 make
831-# the output darker. The value divided by 100 is the actual gamma applied,
832-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
833-# and 100 does not change the gamma.
834-
835-HTML_COLORSTYLE_GAMMA = 80
836-
837-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
838-# page will contain the date and time when the page was generated. Setting
839-# this to NO can help when comparing the output of multiple runs.
840-
841-HTML_TIMESTAMP = YES
842-
843-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
844-# files or namespaces will be aligned in HTML using tables. If set to
845-# NO a bullet list will be used.
846-
847-HTML_ALIGN_MEMBERS = YES
848-
849-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
850-# documentation will contain sections that can be hidden and shown after the
851-# page has loaded. For this to work a browser that supports
852-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
853-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
854-
855-HTML_DYNAMIC_SECTIONS = NO
856-
857-# If the GENERATE_DOCSET tag is set to YES, additional index files
858-# will be generated that can be used as input for Apple's Xcode 3
859-# integrated development environment, introduced with OSX 10.5 (Leopard).
860-# To create a documentation set, doxygen will generate a Makefile in the
861-# HTML output directory. Running make will produce the docset in that
862-# directory and running "make install" will install the docset in
863-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
864-# it at startup.
865-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
866-# for more information.
867-
868-GENERATE_DOCSET = NO
869-
870-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
871-# feed. A documentation feed provides an umbrella under which multiple
872-# documentation sets from a single provider (such as a company or product suite)
873-# can be grouped.
874-
875-DOCSET_FEEDNAME = "Doxygen generated docs"
876-
877-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
878-# should uniquely identify the documentation set bundle. This should be a
879-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
880-# will append .docset to the name.
881-
882-DOCSET_BUNDLE_ID = org.doxygen.Project
883-
884-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
885-# will be generated that can be used as input for tools like the
886-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
887-# of the generated HTML documentation.
888-
889-GENERATE_HTMLHELP = NO
890-
891-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
892-# be used to specify the file name of the resulting .chm file. You
893-# can add a path in front of the file if the result should not be
894-# written to the html output directory.
895-
896-CHM_FILE =
897-
898-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
899-# be used to specify the location (absolute path including file name) of
900-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
901-# the HTML help compiler on the generated index.hhp.
902-
903-HHC_LOCATION =
904-
905-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
906-# controls if a separate .chi index file is generated (YES) or that
907-# it should be included in the master .chm file (NO).
908-
909-GENERATE_CHI = NO
910-
911-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
912-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
913-# content.
914-
915-CHM_INDEX_ENCODING =
916-
917-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
918-# controls whether a binary table of contents is generated (YES) or a
919-# normal table of contents (NO) in the .chm file.
920-
921-BINARY_TOC = NO
922-
923-# The TOC_EXPAND flag can be set to YES to add extra items for group members
924-# to the contents of the HTML help documentation and to the tree view.
925-
926-TOC_EXPAND = NO
927-
928-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
929-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
930-# that can be used as input for Qt's qhelpgenerator to generate a
931-# Qt Compressed Help (.qch) of the generated HTML documentation.
932-
933-GENERATE_QHP = NO
934-
935-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
936-# be used to specify the file name of the resulting .qch file.
937-# The path specified is relative to the HTML output folder.
938-
939-QCH_FILE =
940-
941-# The QHP_NAMESPACE tag specifies the namespace to use when generating
942-# Qt Help Project output. For more information please see
943-# http://doc.trolltech.com/qthelpproject.html#namespace
944-
945-QHP_NAMESPACE = org.doxygen.Project
946-
947-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
948-# Qt Help Project output. For more information please see
949-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
950-
951-QHP_VIRTUAL_FOLDER = doc
952-
953-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
954-# add. For more information please see
955-# http://doc.trolltech.com/qthelpproject.html#custom-filters
956-
957-QHP_CUST_FILTER_NAME =
958-
959-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
960-# custom filter to add. For more information please see
961-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
962-# Qt Help Project / Custom Filters</a>.
963-
964-QHP_CUST_FILTER_ATTRS =
965-
966-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
967-# project's
968-# filter section matches.
969-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
970-# Qt Help Project / Filter Attributes</a>.
971-
972-QHP_SECT_FILTER_ATTRS =
973-
974-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
975-# be used to specify the location of Qt's qhelpgenerator.
976-# If non-empty doxygen will try to run qhelpgenerator on the generated
977-# .qhp file.
978-
979-QHG_LOCATION =
980-
981-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
982-# will be generated, which together with the HTML files, form an Eclipse help
983-# plugin. To install this plugin and make it available under the help contents
984-# menu in Eclipse, the contents of the directory containing the HTML and XML
985-# files needs to be copied into the plugins directory of eclipse. The name of
986-# the directory within the plugins directory should be the same as
987-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
988-# the help appears.
989-
990-GENERATE_ECLIPSEHELP = NO
991-
992-# A unique identifier for the eclipse help plugin. When installing the plugin
993-# the directory name containing the HTML and XML files should also have
994-# this name.
995-
996-ECLIPSE_DOC_ID = org.doxygen.Project
997-
998-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
999-# top of each HTML page. The value NO (the default) enables the index and
1000-# the value YES disables it.
1001-
1002-DISABLE_INDEX = NO
1003-
1004-# This tag can be used to set the number of enum values (range [1..20])
1005-# that doxygen will group on one line in the generated HTML documentation.
1006-
1007-ENUM_VALUES_PER_LINE = 4
1008-
1009-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
1010-# structure should be generated to display hierarchical information.
1011-# If the tag value is set to YES, a side panel will be generated
1012-# containing a tree-like index structure (just like the one that
1013-# is generated for HTML Help). For this to work a browser that supports
1014-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
1015-# Windows users are probably better off using the HTML help feature.
1016-
1017-GENERATE_TREEVIEW = NO
1018-
1019-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
1020-# and Class Hierarchy pages using a tree view instead of an ordered list.
1021-
1022-USE_INLINE_TREES = NO
1023-
1024-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
1025-# used to set the initial width (in pixels) of the frame in which the tree
1026-# is shown.
1027-
1028-TREEVIEW_WIDTH = 250
1029-
1030-# Use this tag to change the font size of Latex formulas included
1031-# as images in the HTML documentation. The default is 10. Note that
1032-# when you change the font size after a successful doxygen run you need
1033-# to manually remove any form_*.png images from the HTML output directory
1034-# to force them to be regenerated.
1035-
1036-FORMULA_FONTSIZE = 10
1037-
1038-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
1039-# for the HTML output. The underlying search engine uses javascript
1040-# and DHTML and should work on any modern browser. Note that when using
1041-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
1042-# (GENERATE_DOCSET) there is already a search function so this one should
1043-# typically be disabled. For large projects the javascript based search engine
1044-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
1045-
1046-SEARCHENGINE = YES
1047-
1048-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
1049-# implemented using a PHP enabled web server instead of at the web client
1050-# using Javascript. Doxygen will generate the search PHP script and index
1051-# file to put on the web server. The advantage of the server
1052-# based approach is that it scales better to large projects and allows
1053-# full text search. The disadvances is that it is more difficult to setup
1054-# and does not have live searching capabilities.
1055-
1056-SERVER_BASED_SEARCH = NO
1057-
1058-#---------------------------------------------------------------------------
1059-# configuration options related to the LaTeX output
1060-#---------------------------------------------------------------------------
1061-
1062-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
1063-# generate Latex output.
1064-
1065-GENERATE_LATEX = NO
1066-
1067-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
1068-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1069-# put in front of it. If left blank `latex' will be used as the default path.
1070-
1071-LATEX_OUTPUT = latex
1072-
1073-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
1074-# invoked. If left blank `latex' will be used as the default command name.
1075-# Note that when enabling USE_PDFLATEX this option is only used for
1076-# generating bitmaps for formulas in the HTML output, but not in the
1077-# Makefile that is written to the output directory.
1078-
1079-LATEX_CMD_NAME = latex
1080-
1081-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
1082-# generate index for LaTeX. If left blank `makeindex' will be used as the
1083-# default command name.
1084-
1085-MAKEINDEX_CMD_NAME = makeindex
1086-
1087-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
1088-# LaTeX documents. This may be useful for small projects and may help to
1089-# save some trees in general.
1090-
1091-COMPACT_LATEX = NO
1092-
1093-# The PAPER_TYPE tag can be used to set the paper type that is used
1094-# by the printer. Possible values are: a4, a4wide, letter, legal and
1095-# executive. If left blank a4wide will be used.
1096-
1097-PAPER_TYPE = a4wide
1098-
1099-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
1100-# packages that should be included in the LaTeX output.
1101-
1102-EXTRA_PACKAGES =
1103-
1104-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
1105-# the generated latex document. The header should contain everything until
1106-# the first chapter. If it is left blank doxygen will generate a
1107-# standard header. Notice: only use this tag if you know what you are doing!
1108-
1109-LATEX_HEADER =
1110-
1111-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
1112-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
1113-# contain links (just like the HTML output) instead of page references
1114-# This makes the output suitable for online browsing using a pdf viewer.
1115-
1116-PDF_HYPERLINKS = YES
1117-
1118-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
1119-# plain latex in the generated Makefile. Set this option to YES to get a
1120-# higher quality PDF documentation.
1121-
1122-USE_PDFLATEX = YES
1123-
1124-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
1125-# command to the generated LaTeX files. This will instruct LaTeX to keep
1126-# running if errors occur, instead of asking the user for help.
1127-# This option is also used when generating formulas in HTML.
1128-
1129-LATEX_BATCHMODE = NO
1130-
1131-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
1132-# include the index chapters (such as File Index, Compound Index, etc.)
1133-# in the output.
1134-
1135-LATEX_HIDE_INDICES = NO
1136-
1137-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
1138-# source code with syntax highlighting in the LaTeX output.
1139-# Note that which sources are shown also depends on other settings
1140-# such as SOURCE_BROWSER.
1141-
1142-LATEX_SOURCE_CODE = NO
1143-
1144-#---------------------------------------------------------------------------
1145-# configuration options related to the RTF output
1146-#---------------------------------------------------------------------------
1147-
1148-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
1149-# The RTF output is optimized for Word 97 and may not look very pretty with
1150-# other RTF readers or editors.
1151-
1152-GENERATE_RTF = NO
1153-
1154-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
1155-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1156-# put in front of it. If left blank `rtf' will be used as the default path.
1157-
1158-RTF_OUTPUT = rtf
1159-
1160-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
1161-# RTF documents. This may be useful for small projects and may help to
1162-# save some trees in general.
1163-
1164-COMPACT_RTF = NO
1165-
1166-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
1167-# will contain hyperlink fields. The RTF file will
1168-# contain links (just like the HTML output) instead of page references.
1169-# This makes the output suitable for online browsing using WORD or other
1170-# programs which support those fields.
1171-# Note: wordpad (write) and others do not support links.
1172-
1173-RTF_HYPERLINKS = NO
1174-
1175-# Load stylesheet definitions from file. Syntax is similar to doxygen's
1176-# config file, i.e. a series of assignments. You only have to provide
1177-# replacements, missing definitions are set to their default value.
1178-
1179-RTF_STYLESHEET_FILE =
1180-
1181-# Set optional variables used in the generation of an rtf document.
1182-# Syntax is similar to doxygen's config file.
1183-
1184-RTF_EXTENSIONS_FILE =
1185-
1186-#---------------------------------------------------------------------------
1187-# configuration options related to the man page output
1188-#---------------------------------------------------------------------------
1189-
1190-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
1191-# generate man pages
1192-
1193-GENERATE_MAN = NO
1194-
1195-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
1196-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1197-# put in front of it. If left blank `man' will be used as the default path.
1198-
1199-MAN_OUTPUT = man
1200-
1201-# The MAN_EXTENSION tag determines the extension that is added to
1202-# the generated man pages (default is the subroutine's section .3)
1203-
1204-MAN_EXTENSION = .3
1205-
1206-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
1207-# then it will generate one additional man file for each entity
1208-# documented in the real man page(s). These additional files
1209-# only source the real man page, but without them the man command
1210-# would be unable to find the correct page. The default is NO.
1211-
1212-MAN_LINKS = NO
1213-
1214-#---------------------------------------------------------------------------
1215-# configuration options related to the XML output
1216-#---------------------------------------------------------------------------
1217-
1218-# If the GENERATE_XML tag is set to YES Doxygen will
1219-# generate an XML file that captures the structure of
1220-# the code including all documentation.
1221-
1222-GENERATE_XML = NO
1223-
1224-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
1225-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1226-# put in front of it. If left blank `xml' will be used as the default path.
1227-
1228-XML_OUTPUT = xml
1229-
1230-# The XML_SCHEMA tag can be used to specify an XML schema,
1231-# which can be used by a validating XML parser to check the
1232-# syntax of the XML files.
1233-
1234-XML_SCHEMA =
1235-
1236-# The XML_DTD tag can be used to specify an XML DTD,
1237-# which can be used by a validating XML parser to check the
1238-# syntax of the XML files.
1239-
1240-XML_DTD =
1241-
1242-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
1243-# dump the program listings (including syntax highlighting
1244-# and cross-referencing information) to the XML output. Note that
1245-# enabling this will significantly increase the size of the XML output.
1246-
1247-XML_PROGRAMLISTING = YES
1248-
1249-#---------------------------------------------------------------------------
1250-# configuration options for the AutoGen Definitions output
1251-#---------------------------------------------------------------------------
1252-
1253-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
1254-# generate an AutoGen Definitions (see autogen.sf.net) file
1255-# that captures the structure of the code including all
1256-# documentation. Note that this feature is still experimental
1257-# and incomplete at the moment.
1258-
1259-GENERATE_AUTOGEN_DEF = NO
1260-
1261-#---------------------------------------------------------------------------
1262-# configuration options related to the Perl module output
1263-#---------------------------------------------------------------------------
1264-
1265-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
1266-# generate a Perl module file that captures the structure of
1267-# the code including all documentation. Note that this
1268-# feature is still experimental and incomplete at the
1269-# moment.
1270-
1271-GENERATE_PERLMOD = NO
1272-
1273-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
1274-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
1275-# to generate PDF and DVI output from the Perl module output.
1276-
1277-PERLMOD_LATEX = NO
1278-
1279-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
1280-# nicely formatted so it can be parsed by a human reader.
1281-# This is useful
1282-# if you want to understand what is going on.
1283-# On the other hand, if this
1284-# tag is set to NO the size of the Perl module output will be much smaller
1285-# and Perl will parse it just the same.
1286-
1287-PERLMOD_PRETTY = YES
1288-
1289-# The names of the make variables in the generated doxyrules.make file
1290-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
1291-# This is useful so different doxyrules.make files included by the same
1292-# Makefile don't overwrite each other's variables.
1293-
1294-PERLMOD_MAKEVAR_PREFIX =
1295-
1296-#---------------------------------------------------------------------------
1297-# Configuration options related to the preprocessor
1298-#---------------------------------------------------------------------------
1299-
1300-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
1301-# evaluate all C-preprocessor directives found in the sources and include
1302-# files.
1303-
1304-ENABLE_PREPROCESSING = YES
1305-
1306-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
1307-# names in the source code. If set to NO (the default) only conditional
1308-# compilation will be performed. Macro expansion can be done in a controlled
1309-# way by setting EXPAND_ONLY_PREDEF to YES.
1310-
1311-MACRO_EXPANSION = NO
1312-
1313-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
1314-# then the macro expansion is limited to the macros specified with the
1315-# PREDEFINED and EXPAND_AS_DEFINED tags.
1316-
1317-EXPAND_ONLY_PREDEF = NO
1318-
1319-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
1320-# in the INCLUDE_PATH (see below) will be search if a #include is found.
1321-
1322-SEARCH_INCLUDES = YES
1323-
1324-# The INCLUDE_PATH tag can be used to specify one or more directories that
1325-# contain include files that are not input files but should be processed by
1326-# the preprocessor.
1327-
1328-INCLUDE_PATH =
1329-
1330-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
1331-# patterns (like *.h and *.hpp) to filter out the header-files in the
1332-# directories. If left blank, the patterns specified with FILE_PATTERNS will
1333-# be used.
1334-
1335-INCLUDE_FILE_PATTERNS =
1336-
1337-# The PREDEFINED tag can be used to specify one or more macro names that
1338-# are defined before the preprocessor is started (similar to the -D option of
1339-# gcc). The argument of the tag is a list of macros of the form: name
1340-# or name=definition (no spaces). If the definition and the = are
1341-# omitted =1 is assumed. To prevent a macro definition from being
1342-# undefined via #undef or recursively expanded use the := operator
1343-# instead of the = operator.
1344-
1345-PREDEFINED =
1346-
1347-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
1348-# this tag can be used to specify a list of macro names that should be expanded.
1349-# The macro definition that is found in the sources will be used.
1350-# Use the PREDEFINED tag if you want to use a different macro definition.
1351-
1352-EXPAND_AS_DEFINED =
1353-
1354-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
1355-# doxygen's preprocessor will remove all function-like macros that are alone
1356-# on a line, have an all uppercase name, and do not end with a semicolon. Such
1357-# function macros are typically used for boiler-plate code, and will confuse
1358-# the parser if not removed.
1359-
1360-SKIP_FUNCTION_MACROS = YES
1361-
1362-#---------------------------------------------------------------------------
1363-# Configuration::additions related to external references
1364-#---------------------------------------------------------------------------
1365-
1366-# The TAGFILES option can be used to specify one or more tagfiles.
1367-# Optionally an initial location of the external documentation
1368-# can be added for each tagfile. The format of a tag file without
1369-# this location is as follows:
1370-#
1371-# TAGFILES = file1 file2 ...
1372-# Adding location for the tag files is done as follows:
1373-#
1374-# TAGFILES = file1=loc1 "file2 = loc2" ...
1375-# where "loc1" and "loc2" can be relative or absolute paths or
1376-# URLs. If a location is present for each tag, the installdox tool
1377-# does not have to be run to correct the links.
1378-# Note that each tag file must have a unique name
1379-# (where the name does NOT include the path)
1380-# If a tag file is not located in the directory in which doxygen
1381-# is run, you must also specify the path to the tagfile here.
1382-
1383-TAGFILES =
1384-
1385-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
1386-# a tag file that is based on the input files it reads.
1387-
1388-GENERATE_TAGFILE =
1389-
1390-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
1391-# in the class index. If set to NO only the inherited external classes
1392-# will be listed.
1393-
1394-ALLEXTERNALS = NO
1395-
1396-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
1397-# in the modules index. If set to NO, only the current project's groups will
1398-# be listed.
1399-
1400-EXTERNAL_GROUPS = YES
1401-
1402-# The PERL_PATH should be the absolute path and name of the perl script
1403-# interpreter (i.e. the result of `which perl').
1404-
1405-PERL_PATH = /usr/bin/perl
1406-
1407-#---------------------------------------------------------------------------
1408-# Configuration options related to the dot tool
1409-#---------------------------------------------------------------------------
1410-
1411-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
1412-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
1413-# or super classes. Setting the tag to NO turns the diagrams off. Note that
1414-# this option is superseded by the HAVE_DOT option below. This is only a
1415-# fallback. It is recommended to install and use dot, since it yields more
1416-# powerful graphs.
1417-
1418-CLASS_DIAGRAMS = YES
1419-
1420-# You can define message sequence charts within doxygen comments using the \msc
1421-# command. Doxygen will then run the mscgen tool (see
1422-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
1423-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
1424-# the mscgen tool resides. If left empty the tool is assumed to be found in the
1425-# default search path.
1426-
1427-MSCGEN_PATH =
1428-
1429-# If set to YES, the inheritance and collaboration graphs will hide
1430-# inheritance and usage relations if the target is undocumented
1431-# or is not a class.
1432-
1433-HIDE_UNDOC_RELATIONS = YES
1434-
1435-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
1436-# available from the path. This tool is part of Graphviz, a graph visualization
1437-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
1438-# have no effect if this option is set to NO (the default)
1439-
1440-HAVE_DOT = YES
1441-
1442-# By default doxygen will write a font called FreeSans.ttf to the output
1443-# directory and reference it in all dot files that doxygen generates. This
1444-# font does not include all possible unicode characters however, so when you need
1445-# these (or just want a differently looking font) you can specify the font name
1446-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
1447-# which can be done by putting it in a standard location or by setting the
1448-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
1449-# containing the font.
1450-
1451-DOT_FONTNAME = FreeSans
1452-
1453-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
1454-# The default size is 10pt.
1455-
1456-DOT_FONTSIZE = 10
1457-
1458-# By default doxygen will tell dot to use the output directory to look for the
1459-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
1460-# different font using DOT_FONTNAME you can set the path where dot
1461-# can find it using this tag.
1462-
1463-DOT_FONTPATH =
1464-
1465-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
1466-# will generate a graph for each documented class showing the direct and
1467-# indirect inheritance relations. Setting this tag to YES will force the
1468-# the CLASS_DIAGRAMS tag to NO.
1469-
1470-CLASS_GRAPH = YES
1471-
1472-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
1473-# will generate a graph for each documented class showing the direct and
1474-# indirect implementation dependencies (inheritance, containment, and
1475-# class references variables) of the class with other documented classes.
1476-
1477-COLLABORATION_GRAPH = YES
1478-
1479-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
1480-# will generate a graph for groups, showing the direct groups dependencies
1481-
1482-GROUP_GRAPHS = YES
1483-
1484-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
1485-# collaboration diagrams in a style similar to the OMG's Unified Modeling
1486-# Language.
1487-
1488-UML_LOOK = NO
1489-
1490-# If set to YES, the inheritance and collaboration graphs will show the
1491-# relations between templates and their instances.
1492-
1493-TEMPLATE_RELATIONS = NO
1494-
1495-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
1496-# tags are set to YES then doxygen will generate a graph for each documented
1497-# file showing the direct and indirect include dependencies of the file with
1498-# other documented files.
1499-
1500-INCLUDE_GRAPH = YES
1501-
1502-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
1503-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
1504-# documented header file showing the documented files that directly or
1505-# indirectly include this file.
1506-
1507-INCLUDED_BY_GRAPH = YES
1508-
1509-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
1510-# doxygen will generate a call dependency graph for every global function
1511-# or class method. Note that enabling this option will significantly increase
1512-# the time of a run. So in most cases it will be better to enable call graphs
1513-# for selected functions only using the \callgraph command.
1514-
1515-CALL_GRAPH = NO
1516-
1517-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
1518-# doxygen will generate a caller dependency graph for every global function
1519-# or class method. Note that enabling this option will significantly increase
1520-# the time of a run. So in most cases it will be better to enable caller
1521-# graphs for selected functions only using the \callergraph command.
1522-
1523-CALLER_GRAPH = NO
1524-
1525-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
1526-# will graphical hierarchy of all classes instead of a textual one.
1527-
1528-GRAPHICAL_HIERARCHY = YES
1529-
1530-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
1531-# then doxygen will show the dependencies a directory has on other directories
1532-# in a graphical way. The dependency relations are determined by the #include
1533-# relations between the files in the directories.
1534-
1535-DIRECTORY_GRAPH = YES
1536-
1537-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
1538-# generated by dot. Possible values are png, jpg, or gif
1539-# If left blank png will be used.
1540-
1541-DOT_IMAGE_FORMAT = png
1542-
1543-# The tag DOT_PATH can be used to specify the path where the dot tool can be
1544-# found. If left blank, it is assumed the dot tool can be found in the path.
1545-
1546-DOT_PATH =
1547-
1548-# The DOTFILE_DIRS tag can be used to specify one or more directories that
1549-# contain dot files that are included in the documentation (see the
1550-# \dotfile command).
1551-
1552-DOTFILE_DIRS =
1553-
1554-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
1555-# nodes that will be shown in the graph. If the number of nodes in a graph
1556-# becomes larger than this value, doxygen will truncate the graph, which is
1557-# visualized by representing a node as a red box. Note that doxygen if the
1558-# number of direct children of the root node in a graph is already larger than
1559-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
1560-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
1561-
1562-DOT_GRAPH_MAX_NODES = 50
1563-
1564-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
1565-# graphs generated by dot. A depth value of 3 means that only nodes reachable
1566-# from the root by following a path via at most 3 edges will be shown. Nodes
1567-# that lay further from the root node will be omitted. Note that setting this
1568-# option to 1 or 2 may greatly reduce the computation time needed for large
1569-# code bases. Also note that the size of a graph can be further restricted by
1570-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
1571-
1572-MAX_DOT_GRAPH_DEPTH = 0
1573-
1574-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
1575-# background. This is disabled by default, because dot on Windows does not
1576-# seem to support this out of the box. Warning: Depending on the platform used,
1577-# enabling this option may lead to badly anti-aliased labels on the edges of
1578-# a graph (i.e. they become hard to read).
1579-
1580-DOT_TRANSPARENT = NO
1581-
1582-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
1583-# files in one run (i.e. multiple -o and -T options on the command line). This
1584-# makes dot run faster, but since only newer versions of dot (>1.8.10)
1585-# support this, this feature is disabled by default.
1586-
1587-DOT_MULTI_TARGETS = NO
1588-
1589-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
1590-# generate a legend page explaining the meaning of the various boxes and
1591-# arrows in the dot generated graphs.
1592-
1593-GENERATE_LEGEND = YES
1594-
1595-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
1596-# remove the intermediate dot files that are used to generate
1597-# the various graphs.
1598-
1599-DOT_CLEANUP = YES
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/MainWindowForm.ui
--- a/qt_pc_server/MainWindowForm.ui Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<ui version="4.0">
3- <class>MainWindowForm</class>
4- <widget class="QMainWindow" name="MainWindowForm">
5- <property name="geometry">
6- <rect>
7- <x>0</x>
8- <y>0</y>
9- <width>584</width>
10- <height>358</height>
11- </rect>
12- </property>
13- <property name="font">
14- <font>
15- <pointsize>12</pointsize>
16- </font>
17- </property>
18- <property name="windowTitle">
19- <string>Hyakutyping Data Server</string>
20- </property>
21- <widget class="QWidget" name="centralwidget">
22- <layout class="QVBoxLayout" name="verticalLayout">
23- <item>
24- <widget class="QTextEdit" name="log_textedit_">
25- <property name="font">
26- <font>
27- <pointsize>12</pointsize>
28- </font>
29- </property>
30- <property name="acceptDrops">
31- <bool>false</bool>
32- </property>
33- <property name="readOnly">
34- <bool>true</bool>
35- </property>
36- </widget>
37- </item>
38- </layout>
39- </widget>
40- <widget class="QMenuBar" name="menubar">
41- <property name="geometry">
42- <rect>
43- <x>0</x>
44- <y>0</y>
45- <width>584</width>
46- <height>22</height>
47- </rect>
48- </property>
49- <widget class="QMenu" name="menu_File">
50- <property name="title">
51- <string>&amp;File</string>
52- </property>
53- <addaction name="action_quit_"/>
54- </widget>
55- <widget class="QMenu" name="menu_About">
56- <property name="title">
57- <string>&amp;Help</string>
58- </property>
59- <addaction name="action_about_"/>
60- </widget>
61- <addaction name="menu_File"/>
62- <addaction name="menu_About"/>
63- </widget>
64- <widget class="QStatusBar" name="statusbar"/>
65- <action name="action_quit_">
66- <property name="text">
67- <string>Quit</string>
68- </property>
69- <property name="shortcut">
70- <string>Ctrl+Q</string>
71- </property>
72- </action>
73- <action name="action_about_">
74- <property name="text">
75- <string>&amp;About</string>
76- </property>
77- </action>
78- </widget>
79- <resources/>
80- <connections/>
81-</ui>
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/ResponseThread.cpp
--- a/qt_pc_server/ResponseThread.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,388 +0,0 @@
1-/*!
2- \file
3- \brief 応答用のスレッド
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-
9- \todo 実際の処理を NetworkHandler に移動させていく
10- \todo 1回の接続で処理できるコマンドの最大数を定義してもよい
11-*/
12-
13-#include "ResponseThread.h"
14-#include "DatabaseHandler.h"
15-#include "TcpipSocket.h"
16-#include "ConnectionUtils.h"
17-#include "authentication.h"
18-#include "delay.h"
19-#include <QTcpSocket>
20-#include <cstdlib>
21-
22-#include "ConnectionRecorder.h"
23-
24-using namespace std;
25-using namespace qrk;
26-
27-
28-namespace
29-{
30- typedef enum {
31- Disconnected, //!< 切断された
32- InvalidType, //!< 無効なタイプ
33- PacketWaiting, //!< 受信の途中
34-
35- CreateAccount, //!< アカウントの作成
36- Authentication, //!< 認証の処理
37- RegisterTypingData, //!< タイピングデータの登録
38- RequestTypingData, //!< タイピングデータの取得
39- RegisterUserData, //!< ユーザデータの登録
40- RequestUserData, //!< ユーザデータの取得
41- } ResponseType;
42-
43-
44- enum {
45- Timeout = 300,
46- BufferSize = 4096,
47- };
48-}
49-
50-
51-struct ResponseThread::pImpl
52-{
53- QTcpSocket* qt_socket_;
54- Connection* socket_;
55- Connection* connection_;
56- bool is_authorized_;
57- string buffer_;
58-
59-
60- pImpl(int socket_descriptor, QObject* parent)
61- : is_authorized_(false)
62- {
63- // !!! 調整し直す
64-
65- qt_socket_ = new QTcpSocket(parent);
66- qt_socket_->setSocketDescriptor(socket_descriptor);
67- connect(qt_socket_, SIGNAL(disconnected()),
68- qt_socket_, SLOT(deleteLater()));
69-
70- socket_ = new TcpipSocket(qt_socket_);
71- connection_ = new ConnectionRecorder(socket_);
72- }
73-
74-
75- ~pImpl(void)
76- {
77- delete connection_;
78- delete socket_;
79- }
80-
81-
82- ResponseType type(Connection* socket,
83- string& error_message, string& packet_data)
84- {
85- typedef struct {
86- string id_tag;
87- size_t id_tag_size;
88- ResponseType type;
89- } command_t;
90-
91- // 実装の関係上、パケットの短い順に並べること
92- command_t commands[] = {
93- { "CA", 2, CreateAccount },
94- { "AU", 2, Authentication },
95- { "WT", 2, RegisterTypingData },
96- { "RT", 2, RequestTypingData },
97- { "WU", 2, RegisterUserData },
98- { "RU", 2, RequestUserData },
99- };
100-
101- // ソケットからデータを読みだす
102- char buffer[BufferSize];
103- int n = readline(socket, buffer, BufferSize - 1, Timeout);
104- if (n > 0) {
105- buffer[n] = '\0';
106- packet_data += buffer;
107- }
108- if (!socket->isConnected()) {
109- // 切断されたら、抜ける
110- return Disconnected;
111- }
112-
113- size_t commands_n = sizeof(commands) / sizeof(commands[0]);
114- size_t i = 0;
115- for (; i < commands_n; ++i) {
116- if (packet_data.size() < commands[i].id_tag_size) {
117- // パケット長が短ければ、受信途中と見なして処理を戻す
118- delay(10);
119- return PacketWaiting;
120- }
121-
122- if (! commands[i].id_tag.compare(0, 2, packet_data)) {
123- // コマンドのタイプを返す
124- return commands[i].type;
125- }
126- }
127-
128- // パケットが見付からない
129- error_message = "Unknown packet: " + packet_data;
130- return InvalidType;
131- }
132-
133-
134- // 処理が完了したら true を返す
135- void handleResponse(std::string& error_message)
136- {
137- if (!connection_) {
138- error_message = "Invalid socket object.";
139- return;
140- }
141-
142- while (true) {
143- ResponseType response_type =
144- type(connection_, error_message, buffer_);
145- fprintf(stderr, "type: %d\n", response_type);
146-
147- switch (response_type) {
148- case CreateAccount:
149- createAccount(connection_, error_message);
150- break;
151-
152- case Authentication:
153- authentication(connection_, error_message);
154- break;
155-
156- case RegisterTypingData:
157- registerTypingData(connection_, error_message);
158- break;
159-
160- case RequestTypingData:
161- requestTypingData(error_message);
162- break;
163-
164- case RegisterUserData:
165- registerUserData(error_message);
166- break;
167-
168- case RequestUserData:
169- requestUserData(error_message);
170- break;
171-
172- case PacketWaiting:
173- case Disconnected:
174- case InvalidType:
175- // 応答なし、想定外のコマンド、および切断されたら処理を終了する
176- buffer_.clear();
177- return;
178- }
179- }
180- }
181-
182-
183- void no_user_id_error(string& error_message)
184- {
185- // ユーザ ID の応答がない
186- error_message = "Authentication fail: no user_id packet.";
187- buffer_.clear();
188- }
189-
190-
191- void invalid_user_id_error(string& error_message, const string& user_id)
192- {
193- // 受信したユーザ ID の長さが不適切
194- error_message = "Authentication fail: invalid user_id: " + user_id;
195- }
196-
197-
198- void createAccount(Connection* socket, string& error_message)
199- {
200- buffer_.clear();
201-
202- DatabaseHandler db;
203-
204- // DB へのユーザ追加
205- string account;
206- string key_code = generateRandomCode();
207- if (!db.createAccount(account, key_code)) {
208- error_message = db.what();
209- return;
210- }
211-
212- // 追加したユーザ情報を返す
213- socket->send(account.c_str(), account.size());
214- socket->send("\n", 1);
215- socket->send(key_code.c_str(), key_code.size());
216- socket->send("\n", 1);
217-
218- buffer_.clear();
219- error_message = "New account was created: " + account;
220- }
221-
222-
223- void authentication(Connection* socket, string& error_message)
224- {
225- buffer_.clear();
226-
227- // ユーザ ID の受信
228- char buffer[BufferSize];
229- int n = readline(socket, buffer, BufferSize, Timeout);
230- if (n <= 0) {
231- no_user_id_error(error_message);
232- return;
233- }
234- string user_id = buffer;
235- buffer_.clear();
236- if (user_id.size() == 0) {
237- invalid_user_id_error(error_message, user_id);
238- return;
239- }
240-
241- // デコード前のキーを作成し、DB に登録してから送信する
242- string send_code = generateRandomCode();
243- socket->send(send_code.c_str(), send_code.size());
244- socket->send("\n", 1);
245-
246- // 指定した user_id の認証コードを取得
247- DatabaseHandler db;
248- string authentication_code;
249- if (! db.authenticationCode(authentication_code, user_id)) {
250- error_message =
251- "Authentication fail: Could not access specified user ID: "
252- + user_id;
253- return;
254- }
255- string expected_code =
256- xor_sha1_code(send_code, authentication_code);
257-
258- // 応答を待ち、認証を行う
259- n = readline(socket, buffer, BufferSize, Timeout);
260- if (n <= 0) {
261- error_message = "Authentication fail: No authentication response.";
262- buffer_.clear();
263- return;
264- }
265-
266- string actual_code = buffer;
267- buffer_.clear();
268- if (! expected_code.compare(actual_code)) {
269- // 認証成功
270- is_authorized_ = true;
271- }
272-
273- if (is_authorized_) {
274- error_message = "Authentication success.";
275- } else {
276- error_message = "Authentication fail: code mismatched.";
277- }
278- }
279-
280-
281- void registerTypingData(Connection* socket, string& error_message)
282- {
283- buffer_.clear();
284- if (!is_authorized_) {
285- fprintf(stderr, "No authorized.\n");
286- return;
287- }
288-
289- // ユーザ ID の受信
290- char buffer[BufferSize];
291- int n = readline(socket, buffer, BufferSize, Timeout);
292- if (n <= 0) {
293- // 受信できなければ、戻る
294- no_user_id_error(error_message);
295- return;
296- }
297- string user_id = buffer;
298- buffer_.clear();
299- if (user_id.size() == 0) {
300- invalid_user_id_error(error_message, user_id);
301- return;
302- }
303-
304- // タイピングデータの受信
305- n = readline(socket, buffer, BufferSize, Timeout);
306- if (n > 0) {
307- fprintf(stderr, "%s\n", buffer);
308- }
309- // !!!
310-
311- // タイピングデータの登録
312- // !!!
313-
314- // !!!
315- buffer_.clear();
316-
317- (void)error_message;
318- }
319-
320-
321- void requestTypingData(string& error_message)
322- {
323- if (!is_authorized_) {
324- //buffer_.clear();
325- return;
326- }
327- (void)error_message;
328-
329- // !!!
330- // !!! 必要に応じてエラーログを送信する
331- }
332-
333-
334- void registerUserData(string& error_message)
335- {
336- if (!is_authorized_) {
337- //buffer_.clear();
338- return;
339- }
340- (void)error_message;
341-
342- // !!!
343- // !!! 必要に応じてエラーログを送信する
344- }
345-
346-
347- void requestUserData(string& error_message)
348- {
349- if (!is_authorized_) {
350- //buffer_.clear();
351- return;
352- }
353- (void)error_message;
354-
355- // !!!
356- // !!! 必要に応じてエラーログを送信する
357- // !!! emit errorMessage("something");
358- }
359-};
360-
361-
362-ResponseThread::ResponseThread(int socket_descriptor, QObject* parent)
363- : QThread(parent), pimpl(new pImpl(socket_descriptor, parent))
364-{
365-}
366-
367-
368-#if 0
369-ResponseThread::ResponseThread(QTcpSocket* socket, QObject* parent)
370- : QThread(parent), pimpl(new pImpl(socket))
371-{
372-}
373-#endif
374-
375-
376-ResponseThread::~ResponseThread(void)
377-{
378-}
379-
380-
381-void ResponseThread::run(void)
382-{
383- string error_message = "";
384- pimpl->handleResponse(error_message);
385- if (!error_message.empty()) {
386- emit resultMessage(error_message.c_str());
387- }
388-}
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/ResponseThread.h
--- a/qt_pc_server/ResponseThread.h Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
1-
2-#ifndef RESPONSE_THREAD_H
3-#define RESPONSE_THREAD_H
4-
5-/*!
6- \file
7- \brief 応答用のスレッド
8-
9- \author Satofumi KAMIMURA
10-
11- $Id$
12-*/
13-
14-#include <QThread>
15-#include <memory>
16-
17-class QTcpSocket;
18-
19-
20-//! 応答用のスレッド
21-class ResponseThread : public QThread
22-{
23- Q_OBJECT;
24-
25-public:
26- ResponseThread(int socket_descriptor, QObject* parent);
27-
28- // !!! 削除する
29- //ResponseThread(QTcpSocket* socket, QObject* parent);
30-
31- ~ResponseThread(void);
32-
33- void run(void);
34-
35-signals:
36- void resultMessage(const QString& message);
37-
38-private:
39- ResponseThread(void);
40- ResponseThread(const ResponseThread& rhs);
41- ResponseThread& operator = (const ResponseThread& rhs);
42-
43- struct pImpl;
44- const std::auto_ptr<pImpl> pimpl;
45-};
46-
47-#endif /* !RESPONSE_THREAD_H */
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/ServerMainWindow.cpp
--- a/qt_pc_server/ServerMainWindow.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
1-/*!
2- \file
3- \brief 「おぼえる、百人一首」用のデータサーバ
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-*/
9-
10-#include "ServerMainWindow.h"
11-#include "DataServer.h"
12-#include "ResponseThread.h"
13-#include "DatabaseHandler.h"
14-#include "log_printf.h"
15-#include <QNetworkInterface>
16-#include <QTcpServer>
17-#include <QTcpSocket>
18-#include <QCloseEvent>
19-#include <QShortcut>
20-#include <QMessageBox>
21-#include <QSettings>
22-#include <algorithm>
23-
24-using namespace qrk;
25-using namespace std;
26-
27-
28-namespace
29-{
30- enum {
31- ServerPort = 57577,
32- };
33-
34- typedef vector<ResponseThread*> Threads;
35-
36- const char* Organization = "hyakuren-soft";
37- const char* Application = "pc_server";
38- const char* Version = "1.0.0";
39-}
40-
41-
42-struct ServerMainWindow::pImpl
43-{
44- ServerMainWindow* widget_;
45- //QTcpServer tcp_server_;
46- DataServer server_;
47- QString server_address_;
48- Threads threads_;
49-
50-
51- pImpl(ServerMainWindow* widget) : widget_(widget)
52- {
53- initializeServerSocket();
54- }
55-
56-
57- void initializeServerSocket(void)
58- {
59- if (! server_.listen(QHostAddress::Any, ServerPort)) {
60- QMessageBox::critical(widget_, tr("Server"),
61- tr("Unable to start the server: %1.")
62- .arg(server_.errorString()));
63- widget_->close();
64- return;
65- }
66-
67- // use the first non-localhost IPv4 address
68- QString ip_address;
69- QList<QHostAddress> ip_addresses = QNetworkInterface::allAddresses();
70- for (int i = 0; i < ip_addresses.size(); ++i) {
71- if (ip_addresses.at(i) != QHostAddress::LocalHost &&
72- ip_addresses.at(i).toIPv4Address()) {
73- ip_address = ip_addresses.at(i).toString();
74- break;
75- }
76- }
77- // if we did not find one, use IPv4 localhost
78- if (ip_address.isEmpty()) {
79- ip_address = QHostAddress(QHostAddress::LocalHost).toString();
80- }
81- server_address_ = ip_address;
82- }
83-
84-
85- void initializeForm(void)
86- {
87- // 初期メッセージを出力
88- addLogMessage(tr("version: ") + Version);
89-
90- // IP アドレス、ポート番号の描画
91- addLogMessage(QString("server: %1").arg(server_address_));
92- addLogMessage(QString("port: %1").arg(server_.serverPort()));
93- addLogMessage("");
94-
95- // メニュー
96- connect(widget_->action_quit_, SIGNAL(triggered()),
97- widget_, SLOT(close()));
98- connect(widget_->action_about_, SIGNAL(triggered()),
99- widget_, SLOT(aboutApplication()));
100-
101- // ショートカット
102- (void)new QShortcut(Qt::ALT + Qt::Key_F4, widget_, SLOT(close()));
103- }
104-
105-
106- void addLogMessage(const QString& message)
107- {
108- widget_->log_textedit_->textCursor().insertText(message + "\n");
109- log_printf("%s\n", message.toStdString().c_str());
110- }
111-
112-
113- void loadSettings(void)
114- {
115- QSettings settings(Organization, Application);
116- widget_->restoreGeometry(settings.value("geometry").toByteArray());
117- }
118-
119-
120- void saveSettings(void)
121- {
122- QSettings settings(Organization, Application);
123- settings.setValue("geometry", widget_->saveGeometry());
124- }
125-};
126-
127-
128-ServerMainWindow::ServerMainWindow(void) : pimpl(new pImpl(this))
129-{
130- setupUi(this);
131- pimpl->initializeForm();
132- pimpl->loadSettings();
133-}
134-
135-
136-ServerMainWindow::~ServerMainWindow(void)
137-{
138- DatabaseHandler::terminate();
139- pimpl->saveSettings();
140-}
141-
142-
143-void ServerMainWindow::addLogMessage(const QString& message)
144-{
145- pimpl->addLogMessage(message);
146-}
147-
148-
149-void ServerMainWindow::closeEvent(QCloseEvent* event)
150-{
151- DatabaseHandler::terminate();
152- event->accept();
153-}
154-
155-
156-void ServerMainWindow::aboutApplication(void)
157-{
158- QString message =
159- "<h3>hyakutyping server " + QString(Version) + "</h3>"
160- "<p>Report bugs to &lt;satofumi@users.sourceforge.jp&gt;</p>";
161-
162- QMessageBox::about(this, tr("Hyakutyping data server"), message);
163-}
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/ServerMainWindow.h
--- a/qt_pc_server/ServerMainWindow.h Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
1-#ifndef SERVER_MAIN_WINDOW_H
2-#define SERVER_MAIN_WINDOW_H
3-
4-/*!
5- \file
6- \brief 「おぼえる、百人一首」用のデータサーバ
7-
8- \author Satofumi KAMIMURA
9-
10- $Id$
11-*/
12-
13-#include "ui_MainWindowForm.h"
14-#include <memory>
15-
16-
17-class ResponseThread;
18-
19-
20-//! データサーバ Window
21-class ServerMainWindow : public QMainWindow, private Ui::MainWindowForm
22-{
23- Q_OBJECT;
24-
25-public:
26- ServerMainWindow(void);
27- ~ServerMainWindow(void);
28-
29-public slots:
30- void addLogMessage(const QString& message);
31-
32-private slots:
33- void closeEvent(QCloseEvent* event);
34- void aboutApplication(void);
35-
36-private:
37- ServerMainWindow(const ServerMainWindow& rhs);
38- ServerMainWindow& operator = (const ServerMainWindow& rhs);
39-
40- struct pImpl;
41- const std::auto_ptr<pImpl> pimpl;
42-};
43-
44-#endif /* !SERVER_MAIN_WINDOW_H */
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/dox/Makefile
--- a/qt_pc_server/dox/Makefile Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
1-# Makefile for pc_server/dox
2-
3-OUTPUT_DIR = ../generated_html
4-
5-all : html
6-
7-clean :
8- cd $(OUTPUT_DIR) && $(RM) -rf *
9-
10-html : $(OUTPUT_DIR)/index.html
11-
12-.PHONY : all clean html
13-######################################################################
14-$(OUTPUT_DIR)/index.html : $(wildcard *.dox) ../Doxyfile
15- cd ../ && doxygen
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/dox/battle.dox
--- a/qt_pc_server/dox/battle.dox Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
1-/*!
2- \page battle_page 対戦の仕組みについて (記述中)
3-
4- 対戦の仕組みを記述する。
5-
6-
7- \section battle_rating レーティングについて
8-
9- - 対戦をどのユーザの組合せで行うかは、レーティングに基づいてサーバが決定する。
10- - 「強い相手と対戦」を指定してレーティング計算を処理できるようにすること
11-
12- - レーティング値の差に基づいて計算を行う
13- \verbatim
14-レーティングの差 上位者の勝ち 下位者の勝ち 引き分け
15- 0〜1 16 16 0
16- 2〜27 16 16 1
17- 28〜46 14 17 2
18- 47〜78 13 18 3
19- 79〜99 11 19 4
20-100〜121 10 20 5
21-122〜151 9 21 6
22-152〜177 8 23 8
23-178〜211 7 24 9
24-212〜253 6 26 10
25-254〜299 5 29 12
26-300〜361 4 32 14
27-362〜448 3 37 17
28-449〜599 2 45 22
29-600〜 1 64 32 \endverbatim
30- http://homepage3.nifty.com/noritnk/reversi/rating.html より
31- \n \n
32- - 勝ったときはレーティング値は増加し、負けたときはレーティング値は減少する
33- \n \n
34- - レーティングは 1000 から開始する
35-
36-
37- !!!
38-
39- \section battle_matching 対戦データの選択方法
40-
41- !!!
42-
43- \n
44-*/
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/dox/database.dox
--- a/qt_pc_server/dox/database.dox Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
1-/*!
2- \page database_page データベース (記述中)
3-
4- データベースのテーブル定義、初期化などについて記述する。
5-
6-
7- \section database_abstract_list 主な要求、および仕様
8-
9- - 一定期間を過ぎても接続がないユーザは、公開するレーティング値を減らすようにする
10- - 接続されれば、また適切なレーティング値を公開するようにする
11-
12- - 対戦履歴のデータから、レーティングの再計算ができるようにする
13-
14- - 一定数以上の対戦履歴が記録された場合、古い対戦履歴のデータは削除してもよい
15- - 必要なければ、削除しないこと
16-
17-
18- \section database_abstract_table テーブル項目
19-
20- 以下の情報を管理する。
21-
22- - ユーザ・アカウント (user_account)
23- - user_id ... ユーザのシリアル ID
24- - key_code ... 認証用のキー・コード
25- - first_access ... 登録した DateTime
26- - last_access ... 最後に接続した DateTime
27- - is_active ... ユーザが有効かどうかのフラグ
28-
29- - 認証用データ (authentication_data)
30- - user_id ... ユーザのシリアル ID
31- - first_access ... 接続した DateTime
32- - authentication_code ... 処理後の認証コード
33-
34- - ユーザのレーティング (user_rating)
35- - シリアル ID
36- - レーティング値
37- - 最終更新の DateTime
38-
39- - 対戦用のタイピングデータ (typing_data)
40- - 対戦データのシリアル ID
41- - 登録したユーザのシリアル ID
42- - デコードした対戦用のタイピングデータ
43- - 登録したときの DateTime
44-
45- - 対戦履歴 (fight_history)
46- - 対戦したユーザのシリアル ID
47- - 対戦したユーザのレーティング値 (対戦前の値)
48- - 対戦されたユーザのシリアル ID
49- - 対戦されたユーザのレーティング値
50- - 対戦された対戦データのシリアル ID
51- - 対戦したときの DateTime
52- - 対戦したユーザに加算されたレーティング値
53- - 対戦したユーザの今回のタイピングデータのシリアル ID
54-
55-
56- \section database_query 問い合わせ
57-
58- - 登録されているの account.user_id の最大値を取得
59- - ユーザアカウントの追加
60-
61- !!!
62-
63- \n
64-*/
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/dox/mainpage.dox
--- a/qt_pc_server/dox/mainpage.dox Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
1-/*!
2- \mainpage 「おぼえる、百人一首」用の PC サーバ
3-
4- PC 用のサーバアプリについて記述する。
5-
6- - \subpage battle_page
7- - \ref battle_rating
8- - \ref battle_matching
9-
10- - \subpage database_page
11- - \ref database_abstract_list
12- - \ref database_abstract_table
13- - \ref database_query
14-
15- - \subpage protocol_page
16- - \ref protocol_create_account
17- - \ref protocol_authentication
18- - \ref protocol_register_typing
19- - \ref protocol_receive_typing
20- - \ref protocol_register_result
21- - \ref protocol_receive_result
22-
23- \n
24-*/
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/dox/protocol.dox
--- a/qt_pc_server/dox/protocol.dox Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
1-/*!
2- \page protocol_page 通信プロトコル
3-
4- クライアントからの送信コマンドと、それに対する応答を記述する。
5-
6- コマンドの種類
7- - \ref protocol_create_account
8- - \ref protocol_authentication
9- - \ref protocol_register_typing
10- - \ref protocol_receive_typing
11- - \ref protocol_register_result
12- - \ref protocol_receive_result
13-
14-
15- \section protocol_create_account アカウントの作成
16-
17- アカウント ID と、128 bit ぶんのキーを2行で送信する。\n
18- 可能ならば、アカウント ID はユーザが入力したメールアドレスなどを用いるべき。
19-
20- - 送信コマンド
21- \verbatim
22-CA\n # Create Account \endverbatim
23-
24- - 応答
25- \verbatim
26-12345678\n # 8 文字の 10 進数
27-deadbeefdeadbeefdeadbeefdeadbeef\n # 32 文字 (128 bit) \endverbatim
28-
29-
30- \section protocol_authentication 認証の処理
31-
32- 認証は、
33-
34- - サーバからフレーズの送信
35- - クライアントで、フレーズとキーの XOR の md5 のハッシュ値を作成
36- - md5 のハッシュ値をサーバに送信
37-
38- という手順で行う。\n
39- 認証結果はサーバからは応答しない。認証に失敗した場合は、以降の応答を全て無視する。
40-
41- - 送信コマンド
42- \verbatim
43-AU\n # Authentication \endverbatim
44-
45- - 応答
46- \verbatim
47-abcdabcdabcdabcdabcdabcdabcdabcd\n # 32 文字 (128 bit) \endverbatim
48-
49- - md5 ハッシュ値の送信 (クライアントから)
50- \verbatim
51-efghefghefghefghefghefghefghefgh\n # 32 文字 (128 bit) \endverbatim
52-
53- md5 ハッシュ値に対しては応答しない。
54-
55-
56- \section protocol_register_typing タイピングデータの登録
57-
58- ネットワーク対戦用の、出題する和歌とキーストロークの情報を扱う。
59- 認証済みの状態で、コマンドとデータを送信して登録する。
60-
61- - 送信コマンド
62- \verbatim
63-WT\n # Write Typing data
64-t,0,a,1,i,2,p,3,i,4,n,5,g,6,u,7,\n
65-d,8,e,-,9,t,10,a,11,\n
66-s,12,a,13,n,14,p,15,u,16,r,17,u,18,\n
67-\n \endverbatim
68-
69- サーバ側は、データ受信が完了したら接続を切断する。
70-
71-
72- \section protocol_receive_typing タイピングデータの取得
73-
74- 認証済みの状態で、コマンドを送信する。
75-
76- - 送信コマンド
77- \verbatim
78-RT\n # Read Typing data
79-0\n # Rating offset \endverbatim
80-
81- - 応答
82- \verbatim
83-t,0,a,1,i,2,p,3,i,4,n,5,g,6,u,7,\n
84-d,8,e,-,9,t,10,a,11,\n
85-s,12,a,13,n,14,p,15,u,16,r,17,u,18,\n
86-\n \endverbatim
87-
88-
89- \section protocol_register_result ユーザデータの登録
90-
91- 対戦結果の情報を扱う。\n
92- 認証済みの状態で、コマンドとデータを送信して登録する。
93-
94- - 送信コマンド
95- \verbatim
96-WU\n # Write User data
97-1,2,3,4,5,\n
98-\n \endverbatim
99-
100- サーバ側は、データ受信が完了したら接続を切断する。
101-
102-
103- \section protocol_receive_result ユーザデータの取得
104-
105- 認証済みの状態で、コマンドを送信する。
106-
107- - 送信コマンド
108- \verbatim
109-RU\n # Read User data \endverbatim
110-
111- - 応答
112- \verbatim
113-1,2,3,4,5,\n
114-\n \endverbatim
115-
116- \n
117-*/
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/main.cpp
--- a/qt_pc_server/main.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
1-/*!
2- \file
3- \brief 「おぼえる、百人一首」用のデータサーバ
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-*/
9-
10-#include <QApplication>
11-#include <QTranslator>
12-#include "ServerMainWindow.h"
13-#include <cstdlib>
14-
15-
16-int main(int argc, char *argv[])
17-{
18- QApplication app(argc, argv);
19-
20- srand(time(NULL));
21-
22- QString locale = QLocale::system().name();
23- QTranslator translator;
24- translator.load("pc_server_" + locale);
25- app.installTranslator(&translator);
26-
27- ServerMainWindow window;
28- window.show();
29-
30- return app.exec();
31-}
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/pc_server.pro
--- a/qt_pc_server/pc_server.pro Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
1-######################################################################
2-# Automatically generated by qmake (2.01a) ? 5? 9 03:49:49 2010
3-######################################################################
4-
5-#CONFIG += release
6-CONFIG += debug
7-QT += network sql
8-TEMPLATE = app
9-TARGET =
10-DEPENDPATH += . .. ../../../../libs/connection ../../../../libs/system
11-INCLUDEPATH += . .. ../../../../libs/connection ../../../../libs/system
12-
13-# Input
14-HEADERS += ServerMainWindow.h ResponseThread.h DatabaseHandler.h DataServer.h
15-FORMS += MainWindowForm.ui
16-SOURCES += main.cpp ServerMainWindow.cpp \
17- ResponseThread.cpp DatabaseHandler.cpp DataServer.cpp \
18- ../authentication.cpp ../sha1.cpp \
19- ../../../../libs/connection/ConnectionUtils.cpp \
20- ../../../../libs/connection/ConnectionRecorder.cpp \
21- ../../../../libs/connection/qt/TcpipSocket.cpp \
22- ../../../../libs/system/log_printf.cpp \
23- ../../../../libs/system/LockGuard.cpp \
24- ../../../../libs/system/qt/Lock.cpp \
25- ../../../../libs/system/qt/delay.cpp \
26-
27-TRANSLATIONS = pc_server_ja.ts
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/pc_server_ja.qm
Binary file qt_pc_server/pc_server_ja.qm has changed
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/pc_server_ja.ts
--- a/qt_pc_server/pc_server_ja.ts Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
1-<?xml version="1.0" encoding="utf-8"?>
2-<!DOCTYPE TS>
3-<TS version="2.0" language="ja_JP">
4-<context>
5- <name>MainWindowForm</name>
6- <message>
7- <location filename="MainWindowForm.ui" line="19"/>
8- <source>Hyakutyping Data Server</source>
9- <translation>百人一首タイピング データサーバ</translation>
10- </message>
11- <message>
12- <location filename="MainWindowForm.ui" line="51"/>
13- <source>&amp;File</source>
14- <translation>ファイル (&amp;F)</translation>
15- </message>
16- <message>
17- <location filename="MainWindowForm.ui" line="57"/>
18- <source>&amp;Help</source>
19- <translation>ヘルプ (&amp;H)</translation>
20- </message>
21- <message>
22- <location filename="MainWindowForm.ui" line="67"/>
23- <source>Quit</source>
24- <translation>終了</translation>
25- </message>
26- <message>
27- <location filename="MainWindowForm.ui" line="70"/>
28- <source>Ctrl+Q</source>
29- <translation></translation>
30- </message>
31- <message>
32- <location filename="MainWindowForm.ui" line="75"/>
33- <source>&amp;About</source>
34- <translation>このアプリケーションについて (&amp;A))</translation>
35- </message>
36-</context>
37-<context>
38- <name>ServerMainWindow</name>
39- <message>
40- <location filename="ServerMainWindow.cpp" line="65"/>
41- <source>Server</source>
42- <translation>サーバ</translation>
43- </message>
44- <message>
45- <location filename="ServerMainWindow.cpp" line="66"/>
46- <source>Unable to start the server: %1.</source>
47- <translation>サーバを起動できません。</translation>
48- </message>
49- <message>
50- <location filename="ServerMainWindow.cpp" line="93"/>
51- <source>version: </source>
52- <translation></translation>
53- </message>
54- <message>
55- <source>Hyakutyping data server: </source>
56- <translation type="obsolete">百人一首タイピング データサーバ: </translation>
57- </message>
58- <message>
59- <location filename="ServerMainWindow.cpp" line="187"/>
60- <source>Hyakutyping data server</source>
61- <translation>百人一首タイピング データサーバ</translation>
62- </message>
63-</context>
64-</TS>
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/samples/Makefile
--- a/qt_pc_server/samples/Makefile Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
1-# Makefile for pc_server/samples
2-
3-all :
4- cd sqlite_sample/ && qmake && $(MAKE)
5- cd tcpip_server_sample/ && qmake && $(MAKE)
6-
7-clean :
8- cd sqlite_sample/ && (if test -f Makefile; then $(MAKE) distclean; fi)
9- cd tcpip_server_sample/ && (if test -f Makefile; then $(MAKE) distclean; fi)
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/samples/sqlite_sample/sqlite_sample.cpp
--- a/qt_pc_server/samples/sqlite_sample/sqlite_sample.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
1-/*!
2- \example sqlite_sample.cpp SQLite の利用サンプル
3-
4- \author Satofumi KAMIMURA
5-
6- $Id$
7-*/
8-
9-#include <QtSql>
10-#include <string>
11-#include <iostream>
12-
13-using namespace std;
14-
15-
16-int main(int argc, char *argv[])
17-{
18- static_cast<void>(argc);
19- static_cast<void>(argv);
20-
21- const char db_name[] = "test.sqlite3";
22-
23- // DB ファイルの削除
24- QFile file(db_name);
25- file.remove();
26-
27- // DB の作成
28- QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
29- db.setDatabaseName(db_name);
30- bool ok = db.open();
31- cout << "open database: " << boolalpha << ok << endl;
32-
33- QSqlQuery query(db);
34-
35- // テーブルの作成
36- query.exec("CREATE TABLE id_table (id)");
37-
38- // データの追加
39- enum { DataMax = 100 };
40- // !!! beginTransaction() を使うようにする
41- query.exec("BEGIN TRANSACTION");
42- for (int i = 0; i < DataMax; ++i) {
43- query.exec(QString("INSERT INTO id_table VALUES(%1)").arg(i));
44- }
45- query.exec("COMMIT");
46-
47- // データの取得
48- query.exec("SELECT id FROM id_table");
49- while (query.next()) {
50- int id = query.value(0).toInt();
51- cout << id << ", ";
52- }
53- cout << endl;
54-
55- return 0;
56-}
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/samples/sqlite_sample/sqlite_sample.pro
--- a/qt_pc_server/samples/sqlite_sample/sqlite_sample.pro Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
1-######################################################################
2-# Automatically generated by qmake (2.01a) ? 5? 27 12:34:52 2010
3-######################################################################
4-
5-QT += sql
6-TEMPLATE = app
7-TARGET =
8-DEPENDPATH += .
9-INCLUDEPATH += .
10-
11-# Input
12-SOURCES += sqlite_sample.cpp
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/samples/tcpip_server_sample/EchobackServer.cpp
--- a/qt_pc_server/samples/tcpip_server_sample/EchobackServer.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
1-/*!
2- \file
3- \brief エコーバック・サーバ
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-*/
9-
10-#include "EchobackServer.h"
11-#include <QTcpServer>
12-#include <QNetworkInterface>
13-
14-
15-struct EchobackServer::pImpl
16-{
17- QTcpServer tcp_server_;
18- QString ip_address_;
19-
20-
21- pImpl(unsigned short port)
22- {
23- tcp_server_.listen(QHostAddress::Any, port);
24- QList<QHostAddress> ip_addresses = QNetworkInterface::allAddresses();
25-
26- for (int i = 0; i < ip_addresses.size(); ++i) {
27- if (ip_addresses.at(i) != QHostAddress::LocalHost &&
28- ip_addresses.at(i).toIPv4Address()) {
29- ip_address_ = ip_addresses.at(i).toString();
30- break;
31- }
32- }
33- if (ip_address_.isEmpty()) {
34- ip_address_ = QHostAddress(QHostAddress::LocalHost).toString();
35- }
36- }
37-};
38-
39-
40-EchobackServer::EchobackServer(unsigned short port) : pimpl(new pImpl(port))
41-{
42-}
43-
44-
45-EchobackServer::~EchobackServer(void)
46-{
47-}
48-
49-
50-std::string EchobackServer::address(void) const
51-{
52- return pimpl->ip_address_.toStdString();
53-}
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/samples/tcpip_server_sample/EchobackServer.h
--- a/qt_pc_server/samples/tcpip_server_sample/EchobackServer.h Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
1-#ifndef ECHOBACK_SERVER_H
2-#define ECHOBACK_SERVER_H
3-
4-/*!
5- \file
6- \brief エコーバック・サーバ
7-
8- \author Satofumi KAMIMURA
9-
10- $Id$
11-*/
12-
13-#include <QObject>
14-#include <memory>
15-
16-
17-class EchobackServer : public QObject
18-{
19- Q_OBJECT;
20-
21-public:
22- EchobackServer(unsigned short port);
23- ~EchobackServer(void);
24-
25- std::string address(void) const;
26- // !!!
27-
28-private:
29- // !!!
30-
31- struct pImpl;
32- std::auto_ptr<pImpl> pimpl;
33-};
34-
35-#endif /* !ECHOBACK_SERVER_H */
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/samples/tcpip_server_sample/tcpip_server_sample.cpp
--- a/qt_pc_server/samples/tcpip_server_sample/tcpip_server_sample.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
1-/*!
2- \example tcpip_server_sample.cpp サーバの動作サンプル
3-
4- \author Satofumi KAMIMURA
5-
6- $Id$
7-*/
8-
9-#include "EchobackServer.h"
10-#include <iostream>
11-
12-using namespace std;
13-
14-
15-namespace
16-{
17- enum {
18- ServerPort = 57577,
19- };
20-}
21-
22-
23-int main(int argc, char *argv[])
24-{
25- static_cast<void>(argc);
26- static_cast<void>(argv);
27-
28- EchobackServer server(ServerPort);
29- cout << server.address() << endl;
30-
31- // !!!
32-
33- return 0;
34-}
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/samples/tcpip_server_sample/tcpip_server_sample.pro
--- a/qt_pc_server/samples/tcpip_server_sample/tcpip_server_sample.pro Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
1-######################################################################
2-# Automatically generated by qmake (2.01a) ? 6? 9 08:03:44 2010
3-######################################################################
4-
5-TEMPLATE = app
6-TARGET =
7-QT += network
8-DEPENDPATH += .
9-INCLUDEPATH += .
10-
11-# Input
12-HEADERS += EchobackServer.h
13-SOURCES += tcpip_server_sample.cpp EchobackServer.cpp
diff -r 47f83febdec5 -r ea1a3e6caa29 qt_pc_server/server_data.sqlite3
Binary file qt_pc_server/server_data.sqlite3 has changed
diff -r 47f83febdec5 -r ea1a3e6caa29 register_typing_data_test.cpp
--- a/register_typing_data_test.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
1-/*!
2- \file
3- \brief タイピングデータの登録テスト
4-
5- \author Satofumi KAMIMURA
6-
7- $Id$
8-*/
9-
10-#include "TcpipSocket.h"
11-#include <iostream>
12-
13-using namespace qrk;
14-using namespace std;
15-
16-
17-int main(int argc, char *argv[])
18-{
19- static_cast<void>(argc);
20- static_cast<void>(argv);
21-
22- // 接続
23- TcpipSocket socket;
24- if (! socket.connect("localhost", 57577)) {
25- cout << socket.what() << endl;
26- return 1;
27- }
28-
29- // 認証
30- socket.send("AU\n", 3);
31-
32- string name = "00000001";
33- socket.send(name.c_str(), name.size());
34- socket.send("\n", 1);
35-
36- // 認証用のキーコードを受信
37- enum {
38- BufferSize = 256,
39- Timeout = 100,
40- };
41- char buffer[BufferSize];
42- int n = socket.receive(buffer, BufferSize - 1, Timeout);
43- cout << "n = " << n << endl;
44- if (n > 0) {
45- buffer[n] = '\0';
46- cout << buffer << endl;
47- }
48-
49-#if 0
50- string key_code
51- socket.send("eb3424563207d2a2daba",
52- socket.send("\n", 1);
53-#endif
54-
55- // !!!
56-
57- // データの送信
58- // !!!
59-
60- //1, w,339,a,389,g,538,a,604,k,736,o,803,r,903,o,1002,m,1085,o,1184,d,1250,e,1415,h,1547,a,1630,-3,1828,t,1917,u,2044,y,2210,u,2324,n,2540,i,2622,n,2738,u,2887,r,2971,e,3004,t,3153,u,3301,t,3350,u,3482,-3,3714,0,0,
61-
62- return 0;
63-}
diff -r 47f83febdec5 -r ea1a3e6caa29 sha1.cpp
--- a/sha1.cpp Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,390 +0,0 @@
1-/*
2- * FIPS-180-1 compliant SHA-1 implementation
3- *
4- * Copyright (C) 2001-2003 Christophe Devine
5- *
6- * This program is free software; you can redistribute it and/or modify
7- * it under the terms of the GNU General Public License as published by
8- * the Free Software Foundation; either version 2 of the License, or
9- * (at your option) any later version.
10- *
11- * This program is distributed in the hope that it will be useful,
12- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14- * GNU General Public License for more details.
15- *
16- * You should have received a copy of the GNU General Public License
17- * along with this program; if not, write to the Free Software
18- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19- */
20-
21-#include <string.h>
22-
23-#include "sha1.h"
24-
25-#define GET_UINT32(n,b,i) \
26- { \
27- (n) = ( (uint32) (b)[(i) ] << 24 ) \
28- | ( (uint32) (b)[(i) + 1] << 16 ) \
29- | ( (uint32) (b)[(i) + 2] << 8 ) \
30- | ( (uint32) (b)[(i) + 3] ); \
31- }
32-
33-#define PUT_UINT32(n,b,i) \
34- { \
35- (b)[(i) ] = (uint8) ( (n) >> 24 ); \
36- (b)[(i) + 1] = (uint8) ( (n) >> 16 ); \
37- (b)[(i) + 2] = (uint8) ( (n) >> 8 ); \
38- (b)[(i) + 3] = (uint8) ( (n) ); \
39- }
40-
41-void sha1_starts( sha1_context *ctx )
42-{
43- ctx->total[0] = 0;
44- ctx->total[1] = 0;
45-
46- ctx->state[0] = 0x67452301;
47- ctx->state[1] = 0xEFCDAB89;
48- ctx->state[2] = 0x98BADCFE;
49- ctx->state[3] = 0x10325476;
50- ctx->state[4] = 0xC3D2E1F0;
51-}
52-
53-void sha1_process( sha1_context *ctx, uint8 data[64] )
54-{
55- uint32 temp, W[16], A, B, C, D, E;
56-
57- GET_UINT32( W[0], data, 0 );
58- GET_UINT32( W[1], data, 4 );
59- GET_UINT32( W[2], data, 8 );
60- GET_UINT32( W[3], data, 12 );
61- GET_UINT32( W[4], data, 16 );
62- GET_UINT32( W[5], data, 20 );
63- GET_UINT32( W[6], data, 24 );
64- GET_UINT32( W[7], data, 28 );
65- GET_UINT32( W[8], data, 32 );
66- GET_UINT32( W[9], data, 36 );
67- GET_UINT32( W[10], data, 40 );
68- GET_UINT32( W[11], data, 44 );
69- GET_UINT32( W[12], data, 48 );
70- GET_UINT32( W[13], data, 52 );
71- GET_UINT32( W[14], data, 56 );
72- GET_UINT32( W[15], data, 60 );
73-
74-#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
75-
76-#define R(t) \
77- ( \
78- temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \
79- W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \
80- ( W[t & 0x0F] = S(temp,1) ) \
81- )
82-
83-#define P(a,b,c,d,e,x) \
84- { \
85- e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \
86- }
87-
88- A = ctx->state[0];
89- B = ctx->state[1];
90- C = ctx->state[2];
91- D = ctx->state[3];
92- E = ctx->state[4];
93-
94-#define F(x,y,z) (z ^ (x & (y ^ z)))
95-#define K 0x5A827999
96-
97- P( A, B, C, D, E, W[0] );
98- P( E, A, B, C, D, W[1] );
99- P( D, E, A, B, C, W[2] );
100- P( C, D, E, A, B, W[3] );
101- P( B, C, D, E, A, W[4] );
102- P( A, B, C, D, E, W[5] );
103- P( E, A, B, C, D, W[6] );
104- P( D, E, A, B, C, W[7] );
105- P( C, D, E, A, B, W[8] );
106- P( B, C, D, E, A, W[9] );
107- P( A, B, C, D, E, W[10] );
108- P( E, A, B, C, D, W[11] );
109- P( D, E, A, B, C, W[12] );
110- P( C, D, E, A, B, W[13] );
111- P( B, C, D, E, A, W[14] );
112- P( A, B, C, D, E, W[15] );
113- P( E, A, B, C, D, R(16) );
114- P( D, E, A, B, C, R(17) );
115- P( C, D, E, A, B, R(18) );
116- P( B, C, D, E, A, R(19) );
117-
118-#undef K
119-#undef F
120-
121-#define F(x,y,z) (x ^ y ^ z)
122-#define K 0x6ED9EBA1
123-
124- P( A, B, C, D, E, R(20) );
125- P( E, A, B, C, D, R(21) );
126- P( D, E, A, B, C, R(22) );
127- P( C, D, E, A, B, R(23) );
128- P( B, C, D, E, A, R(24) );
129- P( A, B, C, D, E, R(25) );
130- P( E, A, B, C, D, R(26) );
131- P( D, E, A, B, C, R(27) );
132- P( C, D, E, A, B, R(28) );
133- P( B, C, D, E, A, R(29) );
134- P( A, B, C, D, E, R(30) );
135- P( E, A, B, C, D, R(31) );
136- P( D, E, A, B, C, R(32) );
137- P( C, D, E, A, B, R(33) );
138- P( B, C, D, E, A, R(34) );
139- P( A, B, C, D, E, R(35) );
140- P( E, A, B, C, D, R(36) );
141- P( D, E, A, B, C, R(37) );
142- P( C, D, E, A, B, R(38) );
143- P( B, C, D, E, A, R(39) );
144-
145-#undef K
146-#undef F
147-
148-#define F(x,y,z) ((x & y) | (z & (x | y)))
149-#define K 0x8F1BBCDC
150-
151- P( A, B, C, D, E, R(40) );
152- P( E, A, B, C, D, R(41) );
153- P( D, E, A, B, C, R(42) );
154- P( C, D, E, A, B, R(43) );
155- P( B, C, D, E, A, R(44) );
156- P( A, B, C, D, E, R(45) );
157- P( E, A, B, C, D, R(46) );
158- P( D, E, A, B, C, R(47) );
159- P( C, D, E, A, B, R(48) );
160- P( B, C, D, E, A, R(49) );
161- P( A, B, C, D, E, R(50) );
162- P( E, A, B, C, D, R(51) );
163- P( D, E, A, B, C, R(52) );
164- P( C, D, E, A, B, R(53) );
165- P( B, C, D, E, A, R(54) );
166- P( A, B, C, D, E, R(55) );
167- P( E, A, B, C, D, R(56) );
168- P( D, E, A, B, C, R(57) );
169- P( C, D, E, A, B, R(58) );
170- P( B, C, D, E, A, R(59) );
171-
172-#undef K
173-#undef F
174-
175-#define F(x,y,z) (x ^ y ^ z)
176-#define K 0xCA62C1D6
177-
178- P( A, B, C, D, E, R(60) );
179- P( E, A, B, C, D, R(61) );
180- P( D, E, A, B, C, R(62) );
181- P( C, D, E, A, B, R(63) );
182- P( B, C, D, E, A, R(64) );
183- P( A, B, C, D, E, R(65) );
184- P( E, A, B, C, D, R(66) );
185- P( D, E, A, B, C, R(67) );
186- P( C, D, E, A, B, R(68) );
187- P( B, C, D, E, A, R(69) );
188- P( A, B, C, D, E, R(70) );
189- P( E, A, B, C, D, R(71) );
190- P( D, E, A, B, C, R(72) );
191- P( C, D, E, A, B, R(73) );
192- P( B, C, D, E, A, R(74) );
193- P( A, B, C, D, E, R(75) );
194- P( E, A, B, C, D, R(76) );
195- P( D, E, A, B, C, R(77) );
196- P( C, D, E, A, B, R(78) );
197- P( B, C, D, E, A, R(79) );
198-
199-#undef K
200-#undef F
201-
202- ctx->state[0] += A;
203- ctx->state[1] += B;
204- ctx->state[2] += C;
205- ctx->state[3] += D;
206- ctx->state[4] += E;
207-}
208-
209-void sha1_update( sha1_context *ctx, uint8 *input, uint32 length )
210-{
211- uint32 left, fill;
212-
213- if( ! length ) return;
214-
215- left = ctx->total[0] & 0x3F;
216- fill = 64 - left;
217-
218- ctx->total[0] += length;
219- ctx->total[0] &= 0xFFFFFFFF;
220-
221- if( ctx->total[0] < length )
222- ctx->total[1]++;
223-
224- if( left && length >= fill )
225- {
226- memcpy( (void *) (ctx->buffer + left),
227- (void *) input, fill );
228- sha1_process( ctx, ctx->buffer );
229- length -= fill;
230- input += fill;
231- left = 0;
232- }
233-
234- while( length >= 64 )
235- {
236- sha1_process( ctx, input );
237- length -= 64;
238- input += 64;
239- }
240-
241- if( length )
242- {
243- memcpy( (void *) (ctx->buffer + left),
244- (void *) input, length );
245- }
246-}
247-
248-static uint8 sha1_padding[64] =
249- {
250- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
251- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
252- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
253- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
254- };
255-
256-void sha1_finish( sha1_context *ctx, uint8 digest[20] )
257-{
258- uint32 last, padn;
259- uint32 high, low;
260- uint8 msglen[8];
261-
262- high = ( ctx->total[0] >> 29 )
263- | ( ctx->total[1] << 3 );
264- low = ( ctx->total[0] << 3 );
265-
266- PUT_UINT32( high, msglen, 0 );
267- PUT_UINT32( low, msglen, 4 );
268-
269- last = ctx->total[0] & 0x3F;
270- padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
271-
272- sha1_update( ctx, sha1_padding, padn );
273- sha1_update( ctx, msglen, 8 );
274-
275- PUT_UINT32( ctx->state[0], digest, 0 );
276- PUT_UINT32( ctx->state[1], digest, 4 );
277- PUT_UINT32( ctx->state[2], digest, 8 );
278- PUT_UINT32( ctx->state[3], digest, 12 );
279- PUT_UINT32( ctx->state[4], digest, 16 );
280-}
281-
282-#ifdef TEST
283-
284-#include <stdlib.h>
285-#include <stdio.h>
286-
287-/*
288- * those are the standard FIPS-180-1 test vectors
289- */
290-
291-static char *msg[] =
292- {
293- "abc",
294- "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
295- NULL
296- };
297-
298-static char *val[] =
299- {
300- "a9993e364706816aba3e25717850c26c9cd0d89d",
301- "84983e441c3bd26ebaae4aa1f95129e5e54670f1",
302- "34aa973cd4c4daa4f61eeb2bdbad27316534016f"
303- };
304-
305-int main( int argc, char *argv[] )
306-{
307- FILE *f;
308- int i, j;
309- char output[41];
310- sha1_context ctx;
311- unsigned char buf[1000];
312- unsigned char sha1sum[20];
313-
314- if( argc < 2 )
315- {
316- printf( "\n SHA-1 Validation Tests:\n\n" );
317-
318- for( i = 0; i < 3; i++ )
319- {
320- printf( " Test %d ", i + 1 );
321-
322- sha1_starts( &ctx );
323-
324- if( i < 2 )
325- {
326- sha1_update( &ctx, (uint8 *) msg[i],
327- strlen( msg[i] ) );
328- }
329- else
330- {
331- memset( buf, 'a', 1000 );
332-
333- for( j = 0; j < 1000; j++ )
334- {
335- sha1_update( &ctx, (uint8 *) buf, 1000 );
336- }
337- }
338-
339- sha1_finish( &ctx, sha1sum );
340-
341- for( j = 0; j < 20; j++ )
342- {
343- sprintf( output + j * 2, "%02x", sha1sum[j] );
344- }
345-
346- if( memcmp( output, val[i], 40 ) )
347- {
348- printf( "failed!\n" );
349- printf("\nPress Enter KEY ");
350- getchar();
351- return( 1 );
352- }
353-
354- printf( "passed.\n" );
355- }
356-
357- printf( "\n" );
358- }
359- else
360- {
361- if( ! ( f = fopen( argv[1], "rb" ) ) )
362- {
363- perror( "fopen" );
364- printf("\nPress Enter KEY ");
365- getchar();
366- return( 1 );
367- }
368-
369- sha1_starts( &ctx );
370-
371- while( ( i = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
372- {
373- sha1_update( &ctx, buf, i );
374- }
375-
376- sha1_finish( &ctx, sha1sum );
377-
378- for( j = 0; j < 20; j++ )
379- {
380- printf( "%02x", sha1sum[j] );
381- }
382-
383- printf( " %s\n", argv[1] );
384- }
385- printf("\nPress Enter KEY ");
386- getchar();
387- return( 0 );
388-}
389-
390-#endif
diff -r 47f83febdec5 -r ea1a3e6caa29 sha1.h
--- a/sha1.h Wed Jan 12 12:37:04 2011 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
1-#ifndef _SHA1_H
2-#define _SHA1_H
3-
4-#ifndef uint8
5-#define uint8 unsigned char
6-#endif
7-
8-#ifndef uint32
9-#define uint32 unsigned long int
10-#endif
11-
12-typedef struct
13-{
14- uint32 total[2];
15- uint32 state[5];
16- uint8 buffer[64];
17-} sha1_context;
18-
19-void sha1_starts( sha1_context *ctx );
20-void sha1_update( sha1_context *ctx, uint8 *input, uint32 length );
21-void sha1_finish( sha1_context *ctx, uint8 digest[20] );
22-
23-#endif /* sha1.h */
旧リポジトリブラウザで表示