From fcf1f65a78f1596b0c83d4a5d79f598df8a13ce9 Mon Sep 17 00:00:00 2001 From: tkawata Date: Sun, 8 Jan 2012 13:06:14 +0900 Subject: [PATCH] Initial implementation of ContainerBuilder. XML parser part hasn't finished yet. --- Source/DNContainerBuilder.cpp | 213 ++++++++++++++++++++++++++++- Source/DNContainerBuilder.h | 13 +- Source/DNContainerServer.cpp | 38 +++++ Source/DNContainerServer.h | 2 + Source/DNDirectory.cpp | 31 +++++ Source/DNDirectory.h | 38 +++++ Source/DNDirectoryImpl.h | 33 +++++ Source/DNFileList.cpp | 35 +++++ Source/DNFileList.h | 37 +++++ Source/DNTimeKeeper.cpp | 19 ++- Source/DNTimeKeeper.h | 19 ++- Source/DNTimeKeeperImpl.h | 19 ++- Source/DNUtils.cpp | 34 +++++ Source/DNUtils.h | 28 ++++ Source/DNXML.cpp | 32 +++++ Source/DNXML.h | 40 ++++++ Source/DNXMLElement.cpp | 43 ++++++ Source/DNXMLElement.h | 41 ++++++ Source/DNXMLImpl.h | 34 +++++ Source/TKJSCellCode.cpp | 21 +-- Source/platform/osx/OSXDNDirectoryImpl.h | 44 ++++++ Source/platform/osx/OSXDNDirectoryImpl.mm | 94 +++++++++++++ Source/platform/osx/OSXDNTimeKeeperImpl.h | 19 ++- Source/platform/osx/OSXDNTimeKeeperImpl.mm | 19 ++- Source/platform/osx/OSXDNXMLImpl.h | 37 +++++ Source/platform/osx/OSXDNXMLImpl.mm | 64 +++++++++ Source/platform/osx/OSXTKLockImpl.h | 19 ++- dennco.xcodeproj/project.pbxproj | 60 +++++++- dennco/AppDelegate.mm | 23 ++++ 29 files changed, 1096 insertions(+), 53 deletions(-) create mode 100644 Source/DNDirectory.cpp create mode 100644 Source/DNDirectory.h create mode 100644 Source/DNDirectoryImpl.h create mode 100644 Source/DNFileList.cpp create mode 100644 Source/DNFileList.h create mode 100644 Source/DNUtils.cpp create mode 100644 Source/DNUtils.h create mode 100644 Source/DNXML.cpp create mode 100644 Source/DNXML.h create mode 100644 Source/DNXMLElement.cpp create mode 100644 Source/DNXMLElement.h create mode 100644 Source/DNXMLImpl.h create mode 100644 Source/platform/osx/OSXDNDirectoryImpl.h create mode 100644 Source/platform/osx/OSXDNDirectoryImpl.mm create mode 100644 Source/platform/osx/OSXDNXMLImpl.h create mode 100644 Source/platform/osx/OSXDNXMLImpl.mm create mode 100644 dennco/AppDelegate.mm diff --git a/Source/DNContainerBuilder.cpp b/Source/DNContainerBuilder.cpp index 48f2f36..a44d471 100644 --- a/Source/DNContainerBuilder.cpp +++ b/Source/DNContainerBuilder.cpp @@ -17,12 +17,219 @@ // Created by tkawata on 1/6/2012. // +#include "TKLock.h" +#include "TKContainer.h" +#include "DNUtils.h" +#include "DNDirectory.h" +#include "DNFileList.h" +#include "DNXML.h" +#include "DNXMLElement.h" +#include "TKLog.h" +#include "DNUtils.h" + #include "DNContainerBuilder.h" -#include "TKContainer.h" -TKContainer* DNContainerBuilder::createContainerFromXHTML(const char* docRoot) +TKContainer* DNContainerBuilder::createContainerFromXHTML(const char* docRoot, TKContainer *targetContainer) { - //TODO + + mLock.lock(); + + mContainer = targetContainer; + + DNDirectory directory(docRoot); + const DNFileList *flist = directory.getFileList("html|htm|xml"); + while(flist) + { + std::string pathString = docRoot; + trimString(pathString); + pathString.append("/"); + pathString.append(flist->filePath); + parseXHTML(pathString.c_str()); + + flist = flist->next; + } + + mLock.unlock(); + + return targetContainer; } +void DNContainerBuilder::parseXHTML(const char *fpath) +{ + DNXML *xml = DNXML::createXMLFromFile(fpath); + DNXMLElement *element = xml->getRoot(); + + DNXMLElement *classElement = NULL; + DNXMLElement *classScriptElement = NULL; + std::string className; + + DNXMLElement *cellElement = NULL; + DNXMLElement *cellAPIElement = NULL; + DNXMLElement *cellScriptElement = NULL; + std::string cellName; + + while(element) + { + std::string eclass = element->attribute("class"); + if (eclass == "dennco-script") + { + DNXMLElement *te = element->outer; + while(te) + { + std::string teclass = te->attribute("class"); + if (teclass == "dennco-classdef") + { + if (classElement && classElement == te) + { + classScriptElement = element; + } + else + { + TKLog::printf("A syntax error is found in %s. dennco-script isn't properly defined.",fpath); + } + + break; + } + else if (teclass == "dennco-cell") + { + if (cellElement && cellElement == te) + { + cellScriptElement = element; + } + else + { + TKLog::printf("A syntax error is found in %s. dennco-script isn't properly defined.",fpath); + } + + break; + } + te = te->outer; + } + if (!te) + { + TKLog::printf("A syntax error is found in %s. dennco-script doesn't belong to any of dennco-classdef or dennco-cell.", fpath); + } + + } + else if (eclass == "dennco-classdef") + { + className = element->attribute("name"); + trimString(className); + if (className.length() > 0) + { + if (!classElement) + { + classElement = element; + } + else + { + TKLog::printf("A syntax error is found in %s. Nested dennco-classdef?", fpath); + } + } + else + { + TKLog::printf("A syntax error is found in %s. dennco-classdef doesn't have name attribute", fpath); + } + } + else if (eclass == "dennco-cell") + { + cellName = element->attribute("name"); + trimString(cellName); + if (cellName.length() > 0) + { + if (!cellElement) + { + cellElement = element; + } + else + { + TKLog::printf("A syntax error is found in %s. Nested dennco-cell?", fpath); + } + } + else + { + TKLog::printf("A syntax error is found in %s. dennco-cell doesn't have name attribute", fpath); + } + } + else if (eclass == "dennco-connect") + { + if (cellElement) + { + //connection + std::string target = element->attribute("href"); + trimString(target); + if (target.length() > 0) + { + mPendingConnection.insert( std::map::value_type( cellName, target)); + } + else + { + TKLog::printf("A syntax error is found in %s. dennco-connect doesn't have link target (href) attribute.", fpath); + } + } + else + { + TKLog::printf("A syntax error is found in %s. dennco-connect doesn't belong to any of dennco-cell.", fpath); + } + } + else if (eclass == "dennco-api") + { + DNXMLElement *te = element->outer; + while(te) + { + std::string teclass = te->attribute("class"); + if (teclass == "dennco-cell") + { + if (cellElement && cellElement == te) + { + cellAPIElement = element; + } + else + { + TKLog::printf("A syntax error is found in %s. dennco-api isn't properly defined.",fpath); + } + + break; + } + te = te->outer; + } + if (!te) + { + TKLog::printf("A syntax error is found in %s. dennco-api doesn't belong to any of dennco-cell.", fpath); + } + } + + if (element->inner) + { + element = element->inner; + } + else + { + while(!element->next && element != xml->getRoot()) + { + element = element->outer; + } + if (element == xml->getRoot()) + { + element = NULL; + } + + if (classElement && element->depth == classElement->depth) + { + //scriptless classdef + classElement = NULL; + classScriptElement = NULL; + + } + if (cellElement && element->depth == cellElement->depth) + { + //scriptless celldef + cellElement = NULL; + cellAPIElement = NULL; + cellScriptElement = NULL; + } + } + } + +} \ No newline at end of file diff --git a/Source/DNContainerBuilder.h b/Source/DNContainerBuilder.h index 36994e9..352f45c 100644 --- a/Source/DNContainerBuilder.h +++ b/Source/DNContainerBuilder.h @@ -20,13 +20,22 @@ #ifndef dennco_TKContainerBuilder_h #define dennco_TKContainerBuilder_h +#include + +#include "TKLock.h" + class TKContainer; class DNContainerBuilder { public: - TKContainer *createContainerFromXHTML(const char* docRoot); - + TKContainer *createContainerFromXHTML(const char* docRoot, TKContainer *container); + void parseXHTML(const char *fpath); + +private: + std::map mPendingConnection; + TKLock mLock; + TKContainer *mContainer; }; diff --git a/Source/DNContainerServer.cpp b/Source/DNContainerServer.cpp index 93d2975..e1544e9 100644 --- a/Source/DNContainerServer.cpp +++ b/Source/DNContainerServer.cpp @@ -67,3 +67,41 @@ void DNContainerServer::doTickThread() delete timeKeeper; } +void DNContainerServer::processClientMessage(const char *message) +{ + int len = strlen(message); + + bool isPost = false; + const char *p; + + if (len < 4) + { + //illegal message + return; + } + if (strncmp(message, "POST", 4) == 0) + { + //POST message + p = message + 4; + isPost = true; + } + else if (strncmp(message, "GET", 3) == 0) + { + //GET message + p = message + 4; + isPost = false; + } + else + { + //non supported message + return; + } + + while (p) + { + + p++; + } +} + + diff --git a/Source/DNContainerServer.h b/Source/DNContainerServer.h index 61228fb..5fcc0f9 100644 --- a/Source/DNContainerServer.h +++ b/Source/DNContainerServer.h @@ -36,6 +36,8 @@ public: void doTickThread(); + void processClientMessage(const char *message); + private: TKContainer *mContainer; int mPortNumber; diff --git a/Source/DNDirectory.cpp b/Source/DNDirectory.cpp new file mode 100644 index 0000000..2a891fb --- /dev/null +++ b/Source/DNDirectory.cpp @@ -0,0 +1,31 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#include "DNDirectoryImpl.h" +#include "DNDirectory.h" + +DNDirectory::DNDirectory(const char *dir) +{ + impl = DNDirectoryImpl::create(dir); +} + +const DNFileList* DNDirectory::getFileList(const char *filter) +{ + return impl->getFileList(filter); +} diff --git a/Source/DNDirectory.h b/Source/DNDirectory.h new file mode 100644 index 0000000..210bf03 --- /dev/null +++ b/Source/DNDirectory.h @@ -0,0 +1,38 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#ifndef dennco_DNDirectory_h +#define dennco_DNDirectory_h + +class DNDirectoryImpl; +class DNFileList; + +class DNDirectory +{ +public: + DNDirectory(const char *dir); + + const DNFileList* getFileList(const char *filter); + +private: + DNDirectoryImpl *impl; +}; + + +#endif diff --git a/Source/DNDirectoryImpl.h b/Source/DNDirectoryImpl.h new file mode 100644 index 0000000..00495f2 --- /dev/null +++ b/Source/DNDirectoryImpl.h @@ -0,0 +1,33 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#ifndef dennco_DNDirectoryImpl_h +#define dennco_DNDirectoryImpl_h + +class DNFileList; + +class DNDirectoryImpl +{ +public: + static DNDirectoryImpl* create(const char *dir); + + virtual const DNFileList* getFileList(const char *filter) = 0; +}; + +#endif diff --git a/Source/DNFileList.cpp b/Source/DNFileList.cpp new file mode 100644 index 0000000..e1875f3 --- /dev/null +++ b/Source/DNFileList.cpp @@ -0,0 +1,35 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#include "DNFileList.h" + +DNFileList::DNFileList(std::string f) : prev(NULL),next(NULL) +{ + filePath = f; +} + +DNFileList::~DNFileList() +{ + if (prev) + { + prev->next = this->next; + } + this->next->prev = prev; + +} diff --git a/Source/DNFileList.h b/Source/DNFileList.h new file mode 100644 index 0000000..2808e2b --- /dev/null +++ b/Source/DNFileList.h @@ -0,0 +1,37 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#ifndef dennco_DNFileList_h +#define dennco_DNFileList_h + +#include + +class DNFileList +{ +public: + DNFileList(std::string f); + + ~DNFileList(); + + DNFileList *next; + DNFileList *prev; + std::string filePath; +}; + +#endif diff --git a/Source/DNTimeKeeper.cpp b/Source/DNTimeKeeper.cpp index ef14701..a1d2672 100644 --- a/Source/DNTimeKeeper.cpp +++ b/Source/DNTimeKeeper.cpp @@ -1,9 +1,20 @@ +// Copyright (c) 2012 Dennco Project // -// DNTimeKeeper.cpp -// dennco +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // -// Created by tkawata on 1/7/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. // #include "DNTimeKeeperImpl.h" diff --git a/Source/DNTimeKeeper.h b/Source/DNTimeKeeper.h index 592cfc7..647e890 100644 --- a/Source/DNTimeKeeper.h +++ b/Source/DNTimeKeeper.h @@ -1,9 +1,20 @@ +// Copyright (c) 2012 Dennco Project // -// DNTimeKeeper.h -// dennco +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // -// Created by tkawata on 1/7/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. // #ifndef dennco_DNTimeKeeper_h diff --git a/Source/DNTimeKeeperImpl.h b/Source/DNTimeKeeperImpl.h index e0ee452..8ea7fc8 100644 --- a/Source/DNTimeKeeperImpl.h +++ b/Source/DNTimeKeeperImpl.h @@ -1,9 +1,20 @@ +// Copyright (c) 2012 Dennco Project // -// DNTimeKeeperImpl.h -// dennco +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // -// Created by tkawata on 1/7/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. // #ifndef dennco_DNTimeKeeperImpl_h diff --git a/Source/DNUtils.cpp b/Source/DNUtils.cpp new file mode 100644 index 0000000..66496bb --- /dev/null +++ b/Source/DNUtils.cpp @@ -0,0 +1,34 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#include "DNUtils.h" + +void trimString(std::string& str) +{ + std::string::size_type pos1 = str.find_first_not_of(' '); + std::string::size_type pos2 = str.find_last_not_of(' '); + std::string::size_type pos1_2 = str.find_first_not_of('\t'); + std::string::size_type pos2_2 = str.find_last_not_of('\t'); + + pos1 = pos1 < pos1_2 ? pos1_2 : pos1; + pos2 = pos2 < pos2_2 ? pos2_2 : pos2; + + str = str.substr(pos1 == std::string::npos ? 0 : pos1, + pos2 == std::string::npos ? str.length() - 1 : pos2 - pos1 + 1); +} diff --git a/Source/DNUtils.h b/Source/DNUtils.h new file mode 100644 index 0000000..8295708 --- /dev/null +++ b/Source/DNUtils.h @@ -0,0 +1,28 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#ifndef dennco_DNUtils_h +#define dennco_DNUtils_h + +#include + +void trimString(std::string& str); + + +#endif diff --git a/Source/DNXML.cpp b/Source/DNXML.cpp new file mode 100644 index 0000000..101b618 --- /dev/null +++ b/Source/DNXML.cpp @@ -0,0 +1,32 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#include "DNXMLImpl.h" +#include "DNXML.h" + +//static +DNXML* DNXML::createXMLFromFile(const char *fpath) +{ + return new DNXML(DNXMLImpl::createXMLFromFileImpl(fpath)); +} + +DNXMLElement* DNXML::getRoot() +{ + return impl->getRoot(); +} diff --git a/Source/DNXML.h b/Source/DNXML.h new file mode 100644 index 0000000..e31e82c --- /dev/null +++ b/Source/DNXML.h @@ -0,0 +1,40 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#ifndef dennco_DNXML_h +#define dennco_DNXML_h + +class DNXMLImpl; +class DNXMLElement; + +class DNXML +{ +public: + static DNXML* createXMLFromFile(const char *fpath); + + DNXMLElement* getRoot(); + +private: + DNXMLImpl *impl; + DNXML(DNXMLImpl *i) : impl(i) {} + + +}; + +#endif diff --git a/Source/DNXMLElement.cpp b/Source/DNXMLElement.cpp new file mode 100644 index 0000000..b0f12d7 --- /dev/null +++ b/Source/DNXMLElement.cpp @@ -0,0 +1,43 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#include "DNXMLElement.h" + +DNXMLElement::DNXMLElement(std::map attributes, std::string body): +mAttributes(attributes), mBody(body) +{ +} + +DNXMLElement::~DNXMLElement() +{ + mAttributes.clear(); +} + +std::string DNXMLElement::attribute(const char *name) +{ + std::map::iterator it = mAttributes.find(name); + if (it != mAttributes.end()) + { + return it->second; + } + else + { + return ""; + } +} diff --git a/Source/DNXMLElement.h b/Source/DNXMLElement.h new file mode 100644 index 0000000..d3a8799 --- /dev/null +++ b/Source/DNXMLElement.h @@ -0,0 +1,41 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#ifndef dennco_DNXMLElement_h +#define dennco_DNXMLElement_h + +#include +#include + +class DNXMLElement +{ +public: + DNXMLElement(std::map attributes, std::string body); + ~DNXMLElement(); + std::string attribute(const char *name); + DNXMLElement *outer; + DNXMLElement *inner; + DNXMLElement *next; + int depth; +private: + std::map mAttributes; + std::string mBody; +}; + +#endif diff --git a/Source/DNXMLImpl.h b/Source/DNXMLImpl.h new file mode 100644 index 0000000..49f2766 --- /dev/null +++ b/Source/DNXMLImpl.h @@ -0,0 +1,34 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#ifndef dennco_DNXMLImpl_h +#define dennco_DNXMLImpl_h + +class DNXML; +class DNXMLElement; + +class DNXMLImpl +{ +public: + static DNXMLImpl* createXMLFromFileImpl(const char *fpath); + + virtual DNXMLElement* getRoot() = 0; +}; + +#endif diff --git a/Source/TKJSCellCode.cpp b/Source/TKJSCellCode.cpp index 059e6ec..998513e 100644 --- a/Source/TKJSCellCode.cpp +++ b/Source/TKJSCellCode.cpp @@ -24,10 +24,9 @@ #include "TKJSCellBase.h" #include "TKJSCellCodeInstance.h" #include "TKDebug.h" +#include "DNUtils.h" #include -void strtrim(std::string& str); - TKCellCodeInstance* TKJSCellCode::createCellCodeInstance(TKCell *owner, void *data) { TKCellCodeInstance *result = NULL; @@ -55,20 +54,6 @@ TKJSCellCode::~TKJSCellCode() { } -void strtrim(std::string& str) -{ - std::string::size_type pos1 = str.find_first_not_of(' '); - std::string::size_type pos2 = str.find_last_not_of(' '); - std::string::size_type pos1_2 = str.find_first_not_of('\t'); - std::string::size_type pos2_2 = str.find_last_not_of('\t'); - - pos1 = pos1 < pos1_2 ? pos1_2 : pos1; - pos2 = pos2 < pos2_2 ? pos2_2 : pos2; - - str = str.substr(pos1 == std::string::npos ? 0 : pos1, - pos2 == std::string::npos ? str.length() - 1 : pos2 - pos1 + 1); -} - TKJSCellCode::TKJSCellCode(TKJSContainer *container, std::string name, std::string code): mName(name), mJsConstructorRef(NULL), @@ -225,7 +210,7 @@ TKJSCellCode::TKJSCellCode(TKJSContainer *container, std::string name, std::stri if( fp != std::string::npos ) { fff = fff.substr(0, fp); - strtrim(fff); + trimString(fff); sp += fp; } else @@ -263,7 +248,7 @@ TKJSCellCode::TKJSCellCode(TKJSContainer *container, std::string name, std::stri //VAR DEF std::string t = ""; t.append(sp,c-sp+1); - strtrim(t); + trimString(t); vars.append("this."); vars.append(t); vars.append("\r\n"); diff --git a/Source/platform/osx/OSXDNDirectoryImpl.h b/Source/platform/osx/OSXDNDirectoryImpl.h new file mode 100644 index 0000000..28a127e --- /dev/null +++ b/Source/platform/osx/OSXDNDirectoryImpl.h @@ -0,0 +1,44 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#ifndef dennco_OSXDNDirectoryImpl_h +#define dennco_OSXDNDirectoryImpl_h + +#include "DNDirectory.h" +#include "DNFileList.h" + +#import + +class OSXDNDirectoryImpl : public DNDirectoryImpl +{ +public: + virtual const DNFileList* getFileList(const char *filter); + + OSXDNDirectoryImpl(const char *dir); + virtual ~OSXDNDirectoryImpl(); + +private: + NSString *mRootDir; + DNFileList *mFileList; + + void cleanFileList(); + +}; + +#endif diff --git a/Source/platform/osx/OSXDNDirectoryImpl.mm b/Source/platform/osx/OSXDNDirectoryImpl.mm new file mode 100644 index 0000000..e2ba707 --- /dev/null +++ b/Source/platform/osx/OSXDNDirectoryImpl.mm @@ -0,0 +1,94 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#include "DNDirectoryImpl.h" +#include "TKLog.h" + +#include "OSXDNDirectoryImpl.h" + + +//static +DNDirectoryImpl* DNDirectoryImpl::create(const char *dir) +{ + return new OSXDNDirectoryImpl(dir); +} + + +OSXDNDirectoryImpl::OSXDNDirectoryImpl(const char *dir) : mFileList(0) +{ + mRootDir = [[NSString alloc] initWithUTF8String:dir]; +} + +OSXDNDirectoryImpl::~OSXDNDirectoryImpl() +{ + cleanFileList(); +} + +void OSXDNDirectoryImpl::cleanFileList() +{ + DNFileList *file = mFileList; + mFileList = 0; + while(file) + { + DNFileList *next = file->next; + delete file; + file = next; + } +} + +const DNFileList* OSXDNDirectoryImpl::getFileList(const char *filter) +{ + cleanFileList(); + + NSString *nfilter = [[NSString alloc] initWithUTF8String:filter]; + NSError *error = NULL; + NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:nfilter + options: NSRegularExpressionCaseInsensitive + error:&error]; + + NSFileManager* fileManager = [NSFileManager defaultManager]; + NSDirectoryEnumerator *dirEnum =[fileManager enumeratorAtPath:mRootDir]; + + NSString *file; + mFileList = 0; + DNFileList *prev = 0; + while (file = [dirEnum nextObject]) { + NSString *fileExt = [file pathExtension]; + NSUInteger m = [regex numberOfMatchesInString:fileExt + options:0 + range:NSMakeRange(0, [fileExt length])]; + + if (m > 0) + { + DNFileList *dnfile = new DNFileList([file UTF8String]); + if (prev) + { + prev->next = dnfile; + prev = dnfile; + } + else + { + mFileList = dnfile; + prev = dnfile; + } + } + } + + return mFileList; +} diff --git a/Source/platform/osx/OSXDNTimeKeeperImpl.h b/Source/platform/osx/OSXDNTimeKeeperImpl.h index 069b738..470920b 100644 --- a/Source/platform/osx/OSXDNTimeKeeperImpl.h +++ b/Source/platform/osx/OSXDNTimeKeeperImpl.h @@ -1,9 +1,20 @@ +// Copyright (c) 2012 Dennco Project // -// OSXDNTimeKeeperImpl.h -// dennco +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // -// Created by tkawata on 1/7/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. // #ifndef dennco_OSXDNTimeKeeperImpl_h diff --git a/Source/platform/osx/OSXDNTimeKeeperImpl.mm b/Source/platform/osx/OSXDNTimeKeeperImpl.mm index 69cd984..7b5dfe7 100644 --- a/Source/platform/osx/OSXDNTimeKeeperImpl.mm +++ b/Source/platform/osx/OSXDNTimeKeeperImpl.mm @@ -1,9 +1,20 @@ +// Copyright (c) 2012 Dennco Project // -// OSXDNTimeKeeperImpl.mm -// dennco +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // -// Created by tkawata on 1/7/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. // #include "OSXDNTimeKeeperImpl.h" diff --git a/Source/platform/osx/OSXDNXMLImpl.h b/Source/platform/osx/OSXDNXMLImpl.h new file mode 100644 index 0000000..b02944b --- /dev/null +++ b/Source/platform/osx/OSXDNXMLImpl.h @@ -0,0 +1,37 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#ifndef dennco_OSXDNXMLImpl_h +#define dennco_OSXDNXMLImpl_h + +#import + +#include "DNXMLImpl.h" + +class OSXDNXMLImpl : public DNXMLImpl +{ +public: + virtual DNXMLElement* getRoot(); + + OSXDNXMLImpl(NSXMLDocument *doc); +private: + NSXMLDocument *mDocument; +}; + +#endif diff --git a/Source/platform/osx/OSXDNXMLImpl.mm b/Source/platform/osx/OSXDNXMLImpl.mm new file mode 100644 index 0000000..c5b0f53 --- /dev/null +++ b/Source/platform/osx/OSXDNXMLImpl.mm @@ -0,0 +1,64 @@ +// Copyright (c) 2012 Dennco Project +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. +// + +#include "DNXML.h" +#include "DNXMLImpl.h" +#include "OSXDNXMLImpl.h" +#include "TKLog.h" + +//static +DNXMLImpl* DNXMLImpl::createXMLFromFileImpl(const char *fpath) +{ + NSString *file = [[NSString alloc]initWithUTF8String:fpath]; + + NSXMLDocument *xmlDoc; + NSError *err=nil; + NSURL *furl = [NSURL fileURLWithPath:file]; + if (!furl) { + TKLog::printf("Can't create an URL from file %s.", fpath); + return 0; + } + xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:furl + options:(NSXMLNodePreserveWhitespace|NSXMLNodePreserveCDATA) + error:&err]; + if (xmlDoc == nil) { + xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:furl + options:NSXMLDocumentTidyXML + error:&err]; + } + if (xmlDoc == nil) { + TKLog::printf("Can't parse xml file %s.", fpath); + return 0; + } + + return new OSXDNXMLImpl(xmlDoc); +} + +OSXDNXMLImpl::OSXDNXMLImpl(NSXMLDocument *doc): +mDocument(doc) +{ + +} + +DNXMLElement* OSXDNXMLImpl::getRoot() +{ + //TODO + TKLog::printf("ERROR!! DNXMLImpl::getRoot not implemented!!\n"); + return 0; +} diff --git a/Source/platform/osx/OSXTKLockImpl.h b/Source/platform/osx/OSXTKLockImpl.h index 546aa4c..00c5b21 100644 --- a/Source/platform/osx/OSXTKLockImpl.h +++ b/Source/platform/osx/OSXTKLockImpl.h @@ -1,9 +1,20 @@ +// Copyright (c) 2012 Dennco Project // -// OSXTKLockImpl.h -// dennco +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // -// Created by tkawata on 1/7/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// +// Created by tkawata on 1/7/2012. // #ifndef dennco_OSXTKLockImpl_h diff --git a/dennco.xcodeproj/project.pbxproj b/dennco.xcodeproj/project.pbxproj index d7c13d4..40b0ebe 100644 --- a/dennco.xcodeproj/project.pbxproj +++ b/dennco.xcodeproj/project.pbxproj @@ -40,12 +40,20 @@ 7FCADFB914B7D9870003A23A /* DNTimeKeeper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFB714B7D9870003A23A /* DNTimeKeeper.cpp */; }; 7FCADFBD14B7DD4E0003A23A /* OSXDNTimeKeeperImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFBC14B7DD4E0003A23A /* OSXDNTimeKeeperImpl.mm */; }; 7FCADFBE14B7DD4E0003A23A /* OSXDNTimeKeeperImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFBC14B7DD4E0003A23A /* OSXDNTimeKeeperImpl.mm */; }; + 7FCADFC014B860F80003A23A /* DNUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFBF14B860F70003A23A /* DNUtils.cpp */; }; + 7FCADFC114B860F80003A23A /* DNUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFBF14B860F70003A23A /* DNUtils.cpp */; }; + 7FCADFC514B86FBF0003A23A /* DNDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFC414B86FBE0003A23A /* DNDirectory.cpp */; }; + 7FCADFCB14B875130003A23A /* DNFileList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFCA14B875120003A23A /* DNFileList.cpp */; }; + 7FCADFCE14B880D00003A23A /* DNXML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFCD14B880CF0003A23A /* DNXML.cpp */; }; + 7FCADFD214B887800003A23A /* DNXMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFD114B8877F0003A23A /* DNXMLElement.cpp */; }; + 7FCADFD514B893170003A23A /* OSXDNXMLImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFD414B893170003A23A /* OSXDNXMLImpl.mm */; }; + 7FCADFD814B8A2DF0003A23A /* OSXDNDirectoryImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7FCADFD714B8A2DF0003A23A /* OSXDNDirectoryImpl.mm */; }; 7FDCE1C814ACBB68002E3FBF /* TKUICell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FDCE1C714ACBB68002E3FBF /* TKUICell.cpp */; }; 7FEF016214A879EA00051DED /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FEF016114A879EA00051DED /* Cocoa.framework */; }; 7FEF016C14A879EB00051DED /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7FEF016A14A879EB00051DED /* InfoPlist.strings */; }; 7FEF016E14A879EB00051DED /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FEF016D14A879EB00051DED /* main.m */; }; 7FEF017214A879EB00051DED /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 7FEF017014A879EB00051DED /* Credits.rtf */; }; - 7FEF017514A879EB00051DED /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FEF017414A879EB00051DED /* AppDelegate.m */; }; + 7FEF017514A879EB00051DED /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7FEF017414A879EB00051DED /* AppDelegate.mm */; }; 7FEF017814A879EB00051DED /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7FEF017614A879EB00051DED /* MainMenu.xib */; }; 7FEF01AB14A87B4A00051DED /* TKConsole.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7FEF018514A87B4A00051DED /* TKConsole.mm */; }; 7FEF01B114A87B4A00051DED /* TKAxon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FEF018D14A87B4A00051DED /* TKAxon.cpp */; }; @@ -125,6 +133,22 @@ 7FCADFBA14B7D9A00003A23A /* DNTimeKeeperImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNTimeKeeperImpl.h; sourceTree = ""; }; 7FCADFBB14B7DD370003A23A /* OSXDNTimeKeeperImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSXDNTimeKeeperImpl.h; sourceTree = ""; }; 7FCADFBC14B7DD4E0003A23A /* OSXDNTimeKeeperImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OSXDNTimeKeeperImpl.mm; sourceTree = ""; }; + 7FCADFBF14B860F70003A23A /* DNUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNUtils.cpp; sourceTree = ""; }; + 7FCADFC214B8610B0003A23A /* DNUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNUtils.h; sourceTree = ""; }; + 7FCADFC314B86FA90003A23A /* DNDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNDirectory.h; sourceTree = ""; }; + 7FCADFC414B86FBE0003A23A /* DNDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNDirectory.cpp; sourceTree = ""; }; + 7FCADFC614B870D80003A23A /* DNDirectoryImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNDirectoryImpl.h; sourceTree = ""; }; + 7FCADFC914B874EC0003A23A /* DNFileList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNFileList.h; sourceTree = ""; }; + 7FCADFCA14B875120003A23A /* DNFileList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNFileList.cpp; sourceTree = ""; }; + 7FCADFCC14B880BD0003A23A /* DNXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNXML.h; sourceTree = ""; }; + 7FCADFCD14B880CF0003A23A /* DNXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNXML.cpp; sourceTree = ""; }; + 7FCADFCF14B8824D0003A23A /* DNXMLImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNXMLImpl.h; sourceTree = ""; }; + 7FCADFD014B8874F0003A23A /* DNXMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNXMLElement.h; sourceTree = ""; }; + 7FCADFD114B8877F0003A23A /* DNXMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNXMLElement.cpp; sourceTree = ""; }; + 7FCADFD314B893040003A23A /* OSXDNXMLImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSXDNXMLImpl.h; sourceTree = ""; }; + 7FCADFD414B893170003A23A /* OSXDNXMLImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OSXDNXMLImpl.mm; sourceTree = ""; }; + 7FCADFD614B8A2C50003A23A /* OSXDNDirectoryImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSXDNDirectoryImpl.h; sourceTree = ""; }; + 7FCADFD714B8A2DF0003A23A /* OSXDNDirectoryImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OSXDNDirectoryImpl.mm; sourceTree = ""; }; 7FDCE1C514ACBB53002E3FBF /* TKUICell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TKUICell.h; sourceTree = ""; }; 7FDCE1C714ACBB68002E3FBF /* TKUICell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TKUICell.cpp; sourceTree = ""; }; 7FEF015D14A879EA00051DED /* dennco.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = dennco.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -138,7 +162,7 @@ 7FEF016F14A879EB00051DED /* dennco-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "dennco-Prefix.pch"; sourceTree = ""; }; 7FEF017114A879EB00051DED /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 7FEF017314A879EB00051DED /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7FEF017414A879EB00051DED /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 7FEF017414A879EB00051DED /* AppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = ""; }; 7FEF017714A879EB00051DED /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 7FEF017F14A87B4A00051DED /* dennco.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dennco.h; sourceTree = ""; }; 7FEF018514A87B4A00051DED /* TKConsole.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TKConsole.mm; sourceTree = ""; }; @@ -256,7 +280,7 @@ isa = PBXGroup; children = ( 7FEF017314A879EB00051DED /* AppDelegate.h */, - 7FEF017414A879EB00051DED /* AppDelegate.m */, + 7FEF017414A879EB00051DED /* AppDelegate.mm */, 7FEF017614A879EB00051DED /* MainMenu.xib */, 7FEF016814A879EB00051DED /* Supporting Files */, ); @@ -318,9 +342,21 @@ 7FCADFA614B733A00003A23A /* DNContainerBuilder.h */, 7FCADFAA14B7418E0003A23A /* DNContainerServer.cpp */, 7FCADFB514B7D9270003A23A /* DNContainerServer.h */, - 7FCADFB614B7D96F0003A23A /* DNTimeKeeper.h */, 7FCADFB714B7D9870003A23A /* DNTimeKeeper.cpp */, + 7FCADFB614B7D96F0003A23A /* DNTimeKeeper.h */, 7FCADFBA14B7D9A00003A23A /* DNTimeKeeperImpl.h */, + 7FCADFC414B86FBE0003A23A /* DNDirectory.cpp */, + 7FCADFC314B86FA90003A23A /* DNDirectory.h */, + 7FCADFC614B870D80003A23A /* DNDirectoryImpl.h */, + 7FCADFCA14B875120003A23A /* DNFileList.cpp */, + 7FCADFC914B874EC0003A23A /* DNFileList.h */, + 7FCADFCD14B880CF0003A23A /* DNXML.cpp */, + 7FCADFCC14B880BD0003A23A /* DNXML.h */, + 7FCADFCF14B8824D0003A23A /* DNXMLImpl.h */, + 7FCADFD114B8877F0003A23A /* DNXMLElement.cpp */, + 7FCADFD014B8874F0003A23A /* DNXMLElement.h */, + 7FCADFBF14B860F70003A23A /* DNUtils.cpp */, + 7FCADFC214B8610B0003A23A /* DNUtils.h */, ); path = Source; sourceTree = ""; @@ -339,8 +375,12 @@ 7FEF018514A87B4A00051DED /* TKConsole.mm */, 7FCADFAE14B7CA010003A23A /* OSXTKLockImpl.mm */, 7FCADFAD14B7C9430003A23A /* OSXTKLockImpl.h */, - 7FCADFBB14B7DD370003A23A /* OSXDNTimeKeeperImpl.h */, 7FCADFBC14B7DD4E0003A23A /* OSXDNTimeKeeperImpl.mm */, + 7FCADFBB14B7DD370003A23A /* OSXDNTimeKeeperImpl.h */, + 7FCADFD414B893170003A23A /* OSXDNXMLImpl.mm */, + 7FCADFD314B893040003A23A /* OSXDNXMLImpl.h */, + 7FCADFD714B8A2DF0003A23A /* OSXDNDirectoryImpl.mm */, + 7FCADFD614B8A2C50003A23A /* OSXDNDirectoryImpl.h */, ); path = osx; sourceTree = ""; @@ -519,7 +559,7 @@ buildActionMask = 2147483647; files = ( 7FEF016E14A879EB00051DED /* main.m in Sources */, - 7FEF017514A879EB00051DED /* AppDelegate.m in Sources */, + 7FEF017514A879EB00051DED /* AppDelegate.mm in Sources */, 7FEF01AB14A87B4A00051DED /* TKConsole.mm in Sources */, 7FEF01B114A87B4A00051DED /* TKAxon.cpp in Sources */, 7FEF01B214A87B4A00051DED /* TKAxonTerminal.cpp in Sources */, @@ -542,6 +582,13 @@ 7FCADFB414B7D0540003A23A /* TKLock.cpp in Sources */, 7FCADFB914B7D9870003A23A /* DNTimeKeeper.cpp in Sources */, 7FCADFBE14B7DD4E0003A23A /* OSXDNTimeKeeperImpl.mm in Sources */, + 7FCADFC114B860F80003A23A /* DNUtils.cpp in Sources */, + 7FCADFC514B86FBF0003A23A /* DNDirectory.cpp in Sources */, + 7FCADFCB14B875130003A23A /* DNFileList.cpp in Sources */, + 7FCADFCE14B880D00003A23A /* DNXML.cpp in Sources */, + 7FCADFD214B887800003A23A /* DNXMLElement.cpp in Sources */, + 7FCADFD514B893170003A23A /* OSXDNXMLImpl.mm in Sources */, + 7FCADFD814B8A2DF0003A23A /* OSXDNDirectoryImpl.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -572,6 +619,7 @@ 7FCADFB314B7D0540003A23A /* TKLock.cpp in Sources */, 7FCADFB814B7D9870003A23A /* DNTimeKeeper.cpp in Sources */, 7FCADFBD14B7DD4E0003A23A /* OSXDNTimeKeeperImpl.mm in Sources */, + 7FCADFC014B860F80003A23A /* DNUtils.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/dennco/AppDelegate.mm b/dennco/AppDelegate.mm new file mode 100644 index 0000000..deed614 --- /dev/null +++ b/dennco/AppDelegate.mm @@ -0,0 +1,23 @@ +// +// AppDelegate.m +// dennco +// +// Created by tkawata on 12/26/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +@synthesize window = _window; + +#include "DNDirectory.h" +#include "DNFileList.h" + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + // Insert code here to initialize your application +} + +@end -- 2.11.0