SVN-fs-dump-format-version: 2
UUID: b259dc2b-b81d-0410-99b0-d7ad1173cfa7
Revision-number: 0
Prop-content-length: 56
Content-length: 56
K 8
svn:date
V 27
2006-09-18T10:52:33.891867Z
PROPS-END
Revision-number: 1
Prop-content-length: 134
Content-length: 134
K 7
svn:log
V 23
Created folder remotely
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T11:01:37.213153Z
PROPS-END
Node-path: trunk
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Revision-number: 2
Prop-content-length: 111
Content-length: 111
K 7
svn:log
V 1
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T11:02:10.658575Z
PROPS-END
Node-path: branches
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Revision-number: 3
Prop-content-length: 134
Content-length: 134
K 7
svn:log
V 23
Created folder remotely
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T11:02:16.881578Z
PROPS-END
Node-path: tags
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Revision-number: 4
Prop-content-length: 134
Content-length: 134
K 7
svn:log
V 23
Added a folder remotely
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T11:06:40.567935Z
PROPS-END
Node-path: trunk/cga-new
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga-new/cga.sln
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1043
Text-content-md5: a398556dda44bbbc60e9722da6efeb93
Content-length: 1053
PROPS-END
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cga", "cga\cga.vcproj", "{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug.ActiveCfg = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug.Build.0 = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release.ActiveCfg = Release|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
Node-path: trunk/cga-new/simple_arch.xml
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 867
Text-content-md5: 77e1d962f7d0e47a68874ccef6a11bd3
Content-length: 877
PROPS-END
Revision-number: 5
Prop-content-length: 127
Content-length: 127
K 7
svn:log
V 16
Renamed remotely
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T11:06:46.191732Z
PROPS-END
Node-path: trunk/cga
Node-kind: dir
Node-action: add
Node-copyfrom-rev: 4
Node-copyfrom-path: trunk/cga-new
Node-path: trunk/cga-new
Node-action: delete
Revision-number: 6
Prop-content-length: 130
Content-length: 130
K 7
svn:log
V 19
Removed file/folder
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T11:06:54.644393Z
PROPS-END
Node-path: trunk/cga
Node-action: delete
Revision-number: 7
Prop-content-length: 139
Content-length: 139
K 7
svn:log
V 28
Initial import to repository
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T11:09:58.390308Z
PROPS-END
Node-path: trunk/cga
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/cga.vcproj
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 18954
Text-content-md5: 7d58e31e57693101db6e2302a2f012b9
Content-length: 18964
PROPS-END
Node-path: trunk/cga/config.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 229
Text-content-md5: 05c786d4324747f0268983f0e3759daf
Content-length: 239
PROPS-END
#ifndef CONFIG_H
#define CONFIG_H
//#pragma warning(disable : 4267)
#include
#include
#define UNDEF_ID UINT_MAX
#define PRINT(x) std::cout << x << std::endl << std::flush;
#endif // CONFIG_H
Node-path: trunk/cga/doc
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/exception.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 511
Text-content-md5: 54a44d514927795e31be107dff72c18e
Content-length: 521
PROPS-END
#include "exception.h"
namespace CGA {
Exception::Exception(const QString msg)
: message_(msg)
{
}
QString Exception::getMessage() {
return message_;
}
FileException::FileException(const QString msg)
: Exception(msg)
{
}
DataBaseException::DataBaseException(const QString msg)
: Exception(msg)
{
}
XMLException::XMLException(const QString msg)
: Exception(msg)
{
}
TraceFileException::TraceFileException(const QString msg)
: Exception(msg)
{
}
} // namespace CGA
Node-path: trunk/cga/exception.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 886
Text-content-md5: bb5cda83e3693d68354ff640e9d60f8b
Content-length: 896
PROPS-END
#ifndef EXCEPTION_H
#define EXCEPTION_H
#include
namespace CGA {
/**
* Base class for Exceptions
*/
class Exception {
public:
Exception(const QString msg = "");
QString getMessage();
private:
QString message_;
};
/**
* Exception handling file errors
*/
class FileException : public Exception {
public:
FileException(const QString msg = "");
};
/**
* Exception handling data base errors
*/
class DataBaseException : public Exception {
public:
DataBaseException(const QString msg = "");
};
/**
* Exception handling XML errors
*/
class XMLException : public Exception {
public:
XMLException(const QString msg = "");
};
/**
* Exception handling TraceFile errors
*/
class TraceFileException : public Exception {
public:
TraceFileException(const QString msg = "");
};
} // namespace CGA
#endif // EXCEPTION_H
Node-path: trunk/cga/exploration
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/exploration/controller
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/exploration/model
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/exploration/view
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/exploration/view/sourcecode
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/exploration/view/startfunc
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/exploration/view/subgraph
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/extraction
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/extraction/architecture
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/extraction/architecture/archmodel.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 9779
Text-content-md5: 4e6bcb3b5348fbd4d675b38272cfcdae
Content-length: 9789
PROPS-END
#include "../../config.h"
#include "archmodel.h"
#include "archmodelxmlreader.h"
#include "dirmodel.h"
#include "../../exception.h"
#include
#include
#include
using VRS::SO;
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
// ////////////////////////////////////////////////////////////////////////
// static factory methods
// ////////////////////////////////////////////////////////////////////////
VRS::SO ArchModel::convertDirModelToArchModel(VRS::SO dirModel) {
unsigned int archRootID = UNDEF_ID;
SO > archID2name =
new VRS::NonPersistentDictionary;
SO > > > archID2children =
new VRS::NonPersistentDictionary > >;
unsigned int dirRootID = UNDEF_ID;
SO > dirID2name =
new VRS::NonPersistentDictionary;
SO > > > dirID2children =
new VRS::NonPersistentDictionary > >;
SO > dirID2archID =
new VRS::NonPersistentDictionary;
dirRootID = archRootID = dirModel->getRootID();
SO > queue = new VRS::NonPersistentDeque;
queue->append(dirRootID);
while (!queue->isEmpty()) {
//
// process next dir
//
unsigned int currentDirID = queue->getElement(0);
unsigned int currentArchID = currentDirID;
queue->removeFirst();
//
// dir -> arch mapping
//
dirID2archID->insert(currentDirID, currentArchID);
//
// name
//
QString name = dirModel->getName(currentDirID);
dirID2name->insert(currentDirID, name.ascii());
archID2name->insert(currentArchID, name.ascii());
//
// children
//
SO > dirChildrenQueue = new VRS::NonPersistentDeque;
SO > archChildrenQueue = new VRS::NonPersistentDeque;
dirID2children->insert(currentDirID, dirChildrenQueue);
archID2children->insert(currentArchID, archChildrenQueue);
SO > it = dirModel->getChildren(currentDirID);
unsigned int i, iMax = it->size();
for (i=0; iget(i);
unsigned int archChild = dirChild;
dirChildrenQueue->append(dirChild);
archChildrenQueue->append(archChild);
queue->append(dirChild);
}
}
SO archModel = new ArchModel(
archRootID,
archID2name,
archID2children,
dirRootID,
dirID2name,
dirID2children,
dirID2archID);
return archModel;
}
VRS::SO ArchModel::loadFromXML(QString file) {
unsigned int archRootID;
SO > archID2name =
new VRS::NonPersistentDictionary;
SO > > > archID2children =
new VRS::NonPersistentDictionary > >;
unsigned int dirRootID;
SO > dirID2name =
new VRS::NonPersistentDictionary;
SO > > > dirID2children =
new VRS::NonPersistentDictionary > >;
SO > dirID2archID =
new VRS::NonPersistentDictionary;
ArchModelXMLReader::read(
file,
&archRootID,
archID2name,
archID2children,
&dirRootID,
dirID2name,
dirID2children,
dirID2archID);
SO model = new ArchModel(
archRootID,
archID2name,
archID2children,
dirRootID,
dirID2name,
dirID2children,
dirID2archID);
return model;
}
// ////////////////////////////////////////////////////////////////////////
// methods to save
// ////////////////////////////////////////////////////////////////////////
void ArchModel::saveToXML(QString file) {
// check file
QFile f(file);
if (!f.open(IO_WriteOnly))
{
throw FileException("Can not open file for writing: " + file);
}
QTextStream stream(&f);
stream.precision(9);
//
// head
//
stream << "\n";
stream << "\n";
stream << "\n";
stream << "\n";
//
// arch componentes
//
stream << "\n";
// use stack of stacks to keep oriented in hierarchy of architecture components
SO > > > stackstack =
new VRS::Stack > >;
SO > children;
unsigned int i, iMax;
SO > entryTagDic =
new VRS::NonPersistentDictionary();
SO > stack = new VRS::Stack;
stackstack->push(stack);
stack->push(getArchRootID());
entryTagDic->insert(getArchRootID(), true);
unsigned int intend = 1;
while (!stackstack->isEmpty()) {
stack = stackstack->top();
while (!stack->isEmpty()) {
// get current architecture component and pop it from stack
unsigned int current = stack->top();
//
// start element ->
//
if (entryTagDic->getValue(current)) {
entryTagDic->insert(current, false);
// write architecture component data
for (i=0; i\n";
intend += 1;
// recurse on children
children = getArchChildren(current);
iMax = children->size();
if (iMax > 0) {
SO > children_stack = new VRS::Stack;
stackstack->push(children_stack);
for (i=0; iget(i);
children_stack->push(child);
entryTagDic->insert(child, true);
}
}
} else {
//
// end element ->
//
stack->pop();
// close architecture component element
intend -= 1;
for (i=0; i\n";
}
stack = stackstack->top();
}
stackstack->pop();
}
stream << "\n";
//
// directories
//
stream << "\n";
// use stack of stacks to keep oriented in hierarchy of directories
stackstack = new VRS::Stack > >;
entryTagDic = new VRS::NonPersistentDictionary();
stack = new VRS::Stack;
stackstack->push(stack);
stack->push(getDirRootID());
entryTagDic->insert(getDirRootID(), true);
intend = 1;
while (!stackstack->isEmpty()) {
stack = stackstack->top();
while (!stack->isEmpty()) {
// get current directory and pop it from stack
unsigned int current = stack->top();
//
// start element ->
//
if (entryTagDic->getValue(current)) {
entryTagDic->insert(current, false);
// write directory data
for (i=0; i\n";
intend += 1;
// recurse on children
children = getDirChildren(current);
iMax = children->size();
if (iMax > 0) {
SO > children_stack = new VRS::Stack;
stackstack->push(children_stack);
for (i=0; iget(i);
children_stack->push(child);
entryTagDic->insert(child, true);
}
}
} else {
//
// end element ->
//
stack->pop();
// close dir element
intend -= 1;
for (i=0; i\n";
}
stack = stackstack->top();
}
stackstack->pop();
}
stream << "\n";
stream << "\n";
//
// close file
//
f.close();
}
// ////////////////////////////////////////////////////////////////////////
// private factory methods
// ////////////////////////////////////////////////////////////////////////
ArchModel::ArchModel(
unsigned int archRootID,
VRS::SO > archID2name,
VRS::SO > > > archID2children,
unsigned int dirRootID,
VRS::SO > dirID2name,
VRS::SO > > > dirID2children,
VRS::SO > dirID2archID) :
archRootID_(archRootID),
archID2name_(archID2name),
archID2children_(archID2children),
dirRootID_(dirRootID),
dirID2name_(dirID2name),
dirID2children_(dirID2children),
dirID2archID_(dirID2archID)
{
}
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
Node-path: trunk/cga/extraction/architecture/archmodel.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 4166
Text-content-md5: cb4f8db1aaf47eaf012c99fb9e0c5807
Content-length: 4176
PROPS-END
#ifndef EXTRACTION_ARCHITECTURE_ARCHMODEL_H
#define EXTRACTION_ARCHITECTURE_ARCHMODEL_H
#include
#include
#include
#include
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
class DirModel;
/**
* ArchModel represents the static system architecture of the analyzed software system.
* It consists of
* a) a tree of architecture components
* b) a tree of directories
* c) for each directory a mapping to an architecture component
*/
class ArchModel : public VRS::SharedObj {
public:
// ////////////////////////////////////////////////////////////////////////
// static factory methods
// ////////////////////////////////////////////////////////////////////////
static VRS::SO convertDirModelToArchModel(VRS::SO);
/// throws FileException or XMLException
static VRS::SO loadFromXML(QString file);
// ////////////////////////////////////////////////////////////////////////
// methods to save
// ////////////////////////////////////////////////////////////////////////
/// throws FileException
void saveToXML(QString file);
// ////////////////////////////////////////////////////////////////////////
// methods to access attributes
// ////////////////////////////////////////////////////////////////////////
unsigned int getArchRootID() const {return archRootID_;}
QString getArchName(unsigned int id) const {VRS_CheckArg(archID2name_->contains(id), "bad id"); return archID2name_->getValue(id).c_str();}
VRS::SO > getArchChildren(unsigned int id) {VRS_CheckArg(archID2children_->contains(id), "bad id"); return archID2children_->getValue(id)->newIterator();}
unsigned int getDirRootID() const {return dirRootID_;}
QString getDirName(unsigned int id) const {VRS_CheckArg(dirID2name_->contains(id), "bad id"); return dirID2name_->getValue(id).c_str();}
VRS::SO > getDirChildren(unsigned int id) {VRS_CheckArg(dirID2children_->contains(id), "bad id"); return dirID2children_->getValue(id)->newIterator();}
unsigned int getArchAssociatedWithDir(unsigned int dirID) {VRS_CheckArg(dirID2archID_->contains(dirID), "bad id"); return dirID2archID_->getValue(dirID);}
// ////////////////////////////////////////////////////////////////////////
// methods to modify attributes
// ////////////////////////////////////////////////////////////////////////
// TODO
private:
// ////////////////////////////////////////////////////////////////////////
// private factory methods
// ////////////////////////////////////////////////////////////////////////
ArchModel(
unsigned int archRootID,
VRS::SO > archID2name,
VRS::SO > > > archID2children,
unsigned int dirRootID,
VRS::SO > dirID2name,
VRS::SO > > > dirID2children,
VRS::SO > dirID2archID);
// ////////////////////////////////////////////////////////////////////////
// private methods to modify attributes
// ////////////////////////////////////////////////////////////////////////
// TODO
unsigned int archRootID_;
VRS::SO > archID2name_;
VRS::SO > > > archID2children_;
unsigned int dirRootID_;
VRS::SO > dirID2name_;
VRS::SO > > > dirID2children_;
VRS::SO > dirID2archID_;
};
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
#endif //EXTRACTION_ARCHITECTURE_ARCHMODEL_H
Node-path: trunk/cga/extraction/architecture/archmodelxmlhandler.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 4521
Text-content-md5: f5cb7597d545c4f5143e56ad97edc60f
Content-length: 4531
PROPS-END
#include "../../config.h"
#include "archmodelxmlhandler.h"
#include "../../exception.h"
#include "../../xmlutil.h"
#include
using VRS::SO;
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
ArchModelXMLHandler::ArchModelXMLHandler(
unsigned int* archRootID,
VRS::SO > archID2name,
VRS::SO > > > archID2children,
unsigned int* dirRootID,
VRS::SO > dirID2name,
VRS::SO > > > dirID2children,
VRS::SO > dirID2archID) :
archRootID_(archRootID),
archID2name_(archID2name),
archID2children_(archID2children),
dirRootID_(dirRootID),
dirID2name_(dirID2name),
dirID2children_(dirID2children),
dirID2archID_(dirID2archID)
{
*archRootID_ = UNDEF_ID;
*dirRootID_ = UNDEF_ID;
parentArchID_ = UNDEF_ID;
parentDirID_ = UNDEF_ID;
archID2parentArchID_ = new VRS::NonPersistentDictionary;
dirID2parentDirID_ = new VRS::NonPersistentDictionary;
}
void ArchModelXMLHandler::endDocument() {
}
void ArchModelXMLHandler::endElement(const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname) {
QString e = XMLUtil::transcode(localname);
if (e == "comp") {
parentArchID_ = archID2parentArchID_->getValue(parentArchID_);
return;
}
if (e == "dir") {
parentDirID_ = dirID2parentDirID_->getValue(parentDirID_);
return;
}
}
void ArchModelXMLHandler::characters(const XMLCh* const chars, const unsigned int length) {
}
void ArchModelXMLHandler::ignorableWhitespace(const XMLCh* const chars, const unsigned int length) {
}
void ArchModelXMLHandler::processingInstruction(const XMLCh* const target, const XMLCh* const data) {
}
void ArchModelXMLHandler::startDocument() {
}
void ArchModelXMLHandler::startElement( const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname,
const xercesc::Attributes& attributes)
{
QString e = XMLUtil::transcode(localname);
if (e == "comp") {
QString name = XMLUtil::transcode(attributes.getValue((unsigned int)0));
unsigned int id = XMLUtil::transcode(attributes.getValue((unsigned int)1)).toUInt();
// set root
if (parentArchID_ == UNDEF_ID)
*archRootID_ = id;
// remember parent
archID2parentArchID_->insert(id, parentArchID_);
// add to parent's list of children
if (parentArchID_ != UNDEF_ID) {
archID2children_->getValue(parentArchID_)->append(id);
}
// create children list for current arch comp
archID2children_->insert(id, new VRS::NonPersistentDeque);
// name
archID2name_->insert(id, name.ascii());
// current is now parent
parentArchID_ = id;
return;
}
if (e == "dir") {
QString name = XMLUtil::transcode(attributes.getValue((unsigned int)0));
unsigned int id = XMLUtil::transcode(attributes.getValue((unsigned int)1)).toUInt();
unsigned int arch = XMLUtil::transcode(attributes.getValue((unsigned int)2)).toUInt();
// set root
if (parentDirID_ == UNDEF_ID)
*dirRootID_ = id;
// remember parent
dirID2parentDirID_->insert(id, parentDirID_);
// add to parent's list of children
if (parentDirID_ != UNDEF_ID) {
dirID2children_->getValue(parentDirID_)->append(id);
}
// create children list for current arch comp
dirID2children_->insert(id, new VRS::NonPersistentDeque);
// name
dirID2name_->insert(id, name.ascii());
// dir -> arch mapping
dirID2archID_->insert(id, arch);
// current is now parent
parentDirID_ = id;
return;
}
}
void ArchModelXMLHandler::warning(const xercesc::SAXParseException& exc) {
throw XMLException("XML warning: " + XMLUtil::transcode(exc.getMessage()));
}
void ArchModelXMLHandler::error(const xercesc::SAXParseException& exc) {
throw XMLException("XML error: " + XMLUtil::transcode(exc.getMessage()));
}
void ArchModelXMLHandler::fatalError(const xercesc::SAXParseException& exc) {
throw XMLException("XML fatalError: " + XMLUtil::transcode(exc.getMessage()));
}
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
Node-path: trunk/cga/extraction/architecture/archmodelxmlhandler.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 2782
Text-content-md5: c21a2a464cb914f4125b1373985d0759
Content-length: 2792
PROPS-END
#ifndef EXTRACTION_ARCHITECTURE_ARCHMODELXMLHANDLER_H
#define EXTRACTION_ARCHITECTURE_ARCHMODELXMLHANDLER_H
#include "../../config.h"
#include
#include
#include
#include
#include
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
/**
* ArchModelXMLHandler is used by ArchModelXMLReader to create an ArchModel from an XML file
*/
class ArchModelXMLHandler : public xercesc::DefaultHandler {
public:
ArchModelXMLHandler(
unsigned int* archRootID,
VRS::SO > archID2name,
VRS::SO > > > archID2children,
unsigned int* dirRootID,
VRS::SO > dirID2name,
VRS::SO > > > dirID2children,
VRS::SO > dirID2archID);
private:
void endDocument();
void endElement( const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname);
void characters(const XMLCh* const chars, const unsigned int length);
void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
void processingInstruction(const XMLCh* const target, const XMLCh* const data);
void startDocument();
void startElement( const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname,
const xercesc::Attributes& attributes);
void warning(const xercesc::SAXParseException& exc);
void error(const xercesc::SAXParseException& exc);
void fatalError(const xercesc::SAXParseException& exc);
private:
unsigned int* archRootID_;
VRS::SO > archID2name_;
VRS::SO > > > archID2children_;
unsigned int* dirRootID_;
VRS::SO > dirID2name_;
VRS::SO > > > dirID2children_;
VRS::SO > dirID2archID_;
unsigned int parentArchID_;
VRS::SO > archID2parentArchID_;
unsigned int parentDirID_;
VRS::SO > dirID2parentDirID_;
};
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
#endif // EXTRACTION_ARCHITECTURE_ARCHMODELXMLHANDLER_H
Node-path: trunk/cga/extraction/architecture/archmodelxmlreader.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 2219
Text-content-md5: b5485820b38a16945ebf5321cc963780
Content-length: 2229
PROPS-END
#include "../../config.h"
#include "archmodelxmlreader.h"
#include "archmodelxmlhandler.h"
#include "../../exception.h"
#include
#include
#include
#include
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
ArchModelXMLReader::ArchModelXMLReader() {
VRS_Error(false, "no instance creation");
}
void ArchModelXMLReader::read(
QString file,
unsigned int* archRootID,
VRS::SO > archID2name,
VRS::SO > > > archID2children,
unsigned int* dirRootID,
VRS::SO > dirID2name,
VRS::SO > > > dirID2children,
VRS::SO > dirID2archID)
{
// check file
QFile f(file);
if (!f.exists() || !f.open(IO_ReadOnly))
{
throw FileException("Can not open file " + file);
}
// Initialize the XML4C2 system
try
{
xercesc::XMLPlatformUtils::Initialize();
}
catch (const xercesc::XMLException&)
{
throw XMLException("Can not initialize XML parser.");
}
xercesc::SAX2XMLReader* parser = xercesc::XMLReaderFactory::createXMLReader();
parser->setFeature(xercesc::XMLUni::fgSAX2CoreValidation, false);
parser->setFeature(xercesc::XMLUni::fgSAX2CoreNameSpaces, true);
parser->setFeature(xercesc::XMLUni::fgXercesSchema, false);
parser->setFeature(xercesc::XMLUni::fgXercesSchemaFullChecking, false);
parser->setFeature(xercesc::XMLUni::fgSAX2CoreNameSpacePrefixes, false);
ArchModelXMLHandler handler(
archRootID,
archID2name,
archID2children,
dirRootID,
dirID2name,
dirID2children,
dirID2archID);
parser->setContentHandler(&handler);
parser->parse(file.ascii());
delete parser;
xercesc::XMLPlatformUtils::Terminate();
// return values are passed in method parameters
return;
}
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
Node-path: trunk/cga/extraction/architecture/archmodelxmlreader.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1210
Text-content-md5: 6840861c222e186070958b79e4848e35
Content-length: 1220
PROPS-END
#ifndef EXTRACTION_ARCHITECTURE_ARCHMODELXMLREADER_H
#define EXTRACTION_ARCHITECTURE_ARCHMODELXMLREADER_H
#include
#include
#include
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
/**
* ArchModelXMLReader has the static method read to create an ArchModel from an XML file
*/
class ArchModelXMLReader {
public:
// throws FileException, XMLException
static void read(
QString file,
unsigned int* archRootID,
VRS::SO > archID2name,
VRS::SO > > > archID2children,
unsigned int* dirRootID,
VRS::SO > dirID2name,
VRS::SO > > > dirID2children,
VRS::SO > dirID2archID);
private:
ArchModelXMLReader();
};
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
#endif // EXTRACTION_ARCHITECTURE_ARCHMODELXMLREADER_H
Node-path: trunk/cga/extraction/architecture/dialogcreate.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1822
Text-content-md5: 0cc7a2d7314cda79cc65dc75686d4c82
Content-length: 1832
PROPS-END
#include "../../config.h"
#include "dialogcreate.h"
#include "archmodel.h"
#include "diranalyzer.h"
#include "dirmodel.h"
#include "../../exception.h"
#include
#include
#include
#include
#include
#include
using VRS::SO;
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
DialogCreate::DialogCreate() :
DialogCreateGUI(NULL, "", true)
{
}
void DialogCreate::create() {
if (lineEditDir->text().isEmpty() ||
lineEditFile->text().isEmpty())
{
QMessageBox::information(this, "Directory or XML file missing", "Fill all fields.");
return;
}
//
// create DirModel
//
SO dirmodel;
SO archmodel;
try {
dirmodel = DirAnalyzer::createDirModel(lineEditDir->text());
//
// convert to ArchModel
//
archmodel = ArchModel::convertDirModelToArchModel(dirmodel);
archmodel->saveToXML(lineEditFile->text());
}
catch (Exception* e) {
QMessageBox::information(this, "Error", e->getMessage());
return;
}
//
// save ArchModel
//
accept();
}
void DialogCreate::chooseDir() {
QString dir = QFileDialog::getExistingDirectory(
QDir::currentDirPath(),
this,
"getDirDialog",
"Choose directory to analyze");
if (dir == QString::null)
return;
lineEditDir->setText(dir);
}
void DialogCreate::chooseFile() {
QString file = QFileDialog::getSaveFileName(
QDir::currentDirPath(),
"architecture xml file (*_arch.xml)",
this,
"saveFileDialog",
"Choose XML filename to save architecture model under");
if (file == QString::null)
return;
lineEditFile->setText(file);
}
void DialogCreate::cancel() {
reject();
}
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
Node-path: trunk/cga/extraction/architecture/dialogcreate.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 557
Text-content-md5: 075b2a19bf594a92db8a948d42e358fc
Content-length: 567
PROPS-END
#ifndef EXTRACION_ARCHITECTURE_DIALOGCREATE_H
#define EXTRACION_ARCHITECTURE_DIALOGCREATE_H
#include "uic/dialogcreategui.h"
#include
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
/**
*
*/
class DialogCreate : public DialogCreateGUI {
Q_OBJECT
public:
DialogCreate();
public slots:
void create();
void cancel();
void chooseDir();
void chooseFile();
private:
};
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
#endif // EXTRACION_ARCHITECTURE_DIALOGCREATE_H
Node-path: trunk/cga/extraction/architecture/dialogcreategui.ui
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 8339
Text-content-md5: d13bc9cff13184111680aa12a13c08b1
Content-length: 8349
PROPS-END
DialogCreateGUI
DialogCreateGUI
0
0
406
103
5
5
0
0
Create Architecture Model From Directory Structure
unnamed
3
textLabel2
0
0
0
0
XML File to Save Model
textLabel1
0
0
0
0
Directory to Analyze
pushButtonCreate
0
0
0
0
Create
pushButtonCancel
0
0
0
0
Cancel
spacer1
Horizontal
Expanding
32000
21
spacer2
Vertical
Expanding
400
16
lineEditDir
NoFocus
LineEditPanel
Sunken
true
lineEditFile
NoFocus
true
toolButtonDir
0
0
0
0
TabFocus
...
toolButtonFile
0
0
0
0
TabFocus
...
pushButtonCancel
clicked()
DialogCreateGUI
cancel()
pushButtonCreate
clicked()
DialogCreateGUI
create()
toolButtonDir
clicked()
DialogCreateGUI
chooseDir()
toolButtonFile
clicked()
DialogCreateGUI
chooseFile()
toolButtonDir
toolButtonFile
pushButtonCreate
pushButtonCancel
lineEditDir
lineEditFile
create()
cancel()
chooseDir()
chooseFile()
Node-path: trunk/cga/extraction/architecture/dialogmodify.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 413
Text-content-md5: 8bde4e9dc5dedc438160e6de5a157919
Content-length: 423
PROPS-END
#include "../../config.h"
#include "dialogmodify.h"
#include "dialogcreate.h"
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
DialogModify::DialogModify() :
DialogModifyGUI(NULL, "", true)
{
}
void DialogModify::foo() {
DialogCreate* dialog = new DialogCreate();
dialog->exec();
delete dialog;
}
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
Node-path: trunk/cga/extraction/architecture/dialogmodify.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 478
Text-content-md5: 7d41d7dc1c65c99bb725c6bb4a2cb1f8
Content-length: 488
PROPS-END
#ifndef EXTRACION_ARCHITECTURE_DIALOGMODIFY_H
#define EXTRACION_ARCHITECTURE_DIALOGMODIFY_H
#include "uic/dialogmodifygui.h"
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
/**
*
*/
class DialogModify : public DialogModifyGUI {
Q_OBJECT
public:
DialogModify();
public slots:
void foo();
private:
};
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
#endif // EXTRACION_ARCHITECTURE_DIALOGMODIFY_H
Node-path: trunk/cga/extraction/architecture/dialogmodifygui.ui
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 2515
Text-content-md5: 838fa15e8d9ff5826c2c6e80ea0c329f
Content-length: 2525
PROPS-END
DialogModifyGUI
DialogModifyGUI
0
0
481
154
5
5
0
0
Architecture Model Modification
unnamed
3
pushButtonFoo
IchBinEinButtonZumErzeugenEinesInitialmodellsDurchVerzeichnisParsen
pushButtonCancel
0
0
0
0
Cancel
pushButtonCancel
clicked()
DialogModifyGUI
cancel()
pushButtonFoo
clicked()
DialogModifyGUI
foo()
pushButtonCancel
foo()
cancel()
Node-path: trunk/cga/extraction/architecture/diranalyzer.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 2994
Text-content-md5: d52980bb81d6860d61e344fa603c55c7
Content-length: 3004
PROPS-END
#include "../../config.h"
#include "diranalyzer.h"
#include "../../exception.h"
#include
#include
#include
#include
#include
#include
#include
#include
using VRS::SO;
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
DirAnalyzer::DirAnalyzer() {
VRS_Error(false, "no instances of DirAnalyzer possible");
}
VRS::SO DirAnalyzer::createDirModel(QString directory) {
//
// analyze directory
//
QDir dir(directory);
if (!dir.exists()) {
throw FileException("Directory " + directory + " does not exist!");
}
unsigned int nextUnusedID = 0;
QProgressDialog* progress = new QProgressDialog("Analyzing: "+directory, "Abort", 200, NULL, "progress", TRUE);
progress->show();
unsigned int steps = 0;
SO > fullPathDic = new VRS::NonPersistentDictionary();
SO > pathDic = new VRS::NonPersistentDictionary();
SO > > > childrenQueueDic =
new VRS::NonPersistentDictionary > >();
SO > dirQueue = new VRS::NonPersistentDeque();
// root dir
unsigned int rootID = nextUnusedID++;
QString absPath = dir.absPath();
QString dirName = dir.dirName();
fullPathDic->insert(rootID, dir.absPath().ascii());
pathDic->insert(rootID, dir.dirName().ascii());
dirQueue->append(rootID);
// get all directories
while (!dirQueue->isEmpty()) {
progress->setProgress(steps++);
if (steps == 200) steps = 0;
unsigned int currentID = dirQueue->getElement(0);
dirQueue->removeFirst();
SO > childrenQueue = new VRS::NonPersistentDeque();
childrenQueueDic->insert(currentID, childrenQueue);
QString fullPath = fullPathDic->getValue(currentID).c_str();
dir.setPath(fullPath);
dir.setFilter(QDir::Dirs);
const QFileInfoList* list = dir.entryInfoList();
for (QFileInfoList::Iterator it = list->begin(); it != list->end(); it++) {
if ( (*it)->fileName() != "."
&& (*it)->fileName() != ".."
&& (*it)->fileName() != "CVS"
&& (*it)->fileName() != ".svn")
{
unsigned int id = nextUnusedID++;
childrenQueue->append(id);
fullPathDic->insert(id, (*it)->filePath().ascii());
pathDic->insert(id, (*it)->fileName().ascii());
dirQueue->append(id);
}
}
}
//
// create DirModel
//
SO model = new DirModel(
rootID,
pathDic,
childrenQueueDic);
delete progress;
return model;
}
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
Node-path: trunk/cga/extraction/architecture/diranalyzer.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 610
Text-content-md5: e829bff21b9480bdcc55042293d24750
Content-length: 620
PROPS-END
#ifndef EXTRACTION_ARCHITECTURE_DIRANALYZER_H
#define EXTRACTION_ARCHITECTURE_DIRANALYZER_H
#include "dirmodel.h"
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
/**
* DirAnalyzer provides a static method to analyze all subdirectories of a given directory and converting them into
* a DirModel.
*/
class DirAnalyzer {
public:
// throws FileException
static VRS::SO createDirModel(QString directory);
private:
DirAnalyzer();
};
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
#endif //EXTRACTION_ARCHITECTURE_DIRANALYZER_H
Node-path: trunk/cga/extraction/architecture/dirmodel.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 530
Text-content-md5: d6f9b5b561dc9075b46554188f90a75d
Content-length: 540
PROPS-END
#include "../../config.h"
#include "dirmodel.h"
using VRS::SO;
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
DirModel::DirModel(
unsigned int rootID,
VRS::SO > id2name,
VRS::SO > > > id2children) :
rootID_(rootID),
id2name_(id2name),
id2children_(id2children)
{
}
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
Node-path: trunk/cga/extraction/architecture/dirmodel.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1303
Text-content-md5: 6dfeaed61b4387117136536b4a79f3de
Content-length: 1313
PROPS-END
#ifndef EXTRACTION_ARCHITECTURE_DIRMODEL_H
#define EXTRACTION_ARCHITECTURE_DIRMODEL_H
#include
#include
#include
#include
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
/**
* DirModel
*/
class DirModel : public VRS::SharedObj {
public:
DirModel(
unsigned int rootID,
VRS::SO > id2name,
VRS::SO > > > id2children);
unsigned int getRootID() const {return rootID_;}
QString getName(unsigned int id) const {VRS_CheckArg(id2name_->contains(id), "bad id"); return id2name_->getValue(id).c_str();}
VRS::SO > getChildren(unsigned int id) {VRS_CheckArg(id2children_->contains(id), "bad id"); return id2children_->getValue(id)->newIterator();}
private:
unsigned int rootID_;
VRS::SO > id2name_;
VRS::SO > > > id2children_;
};
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
#endif //EXTRACTION_ARCHITECTURE_DIRMODEL_H
Node-path: trunk/cga/extraction/callgraph
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/extraction/extractiongui.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 422
Text-content-md5: 620f919ff8b1786929730c752a93bdc0
Content-length: 432
PROPS-END
#include "../config.h"
#include "extractiongui.h"
#include "architecture/dialogmodify.h"
namespace CGA {
namespace EXTRACTION {
ExtractionGui::ExtractionGui(QFrame* frame) :
ExtractionGuiUI(frame)
{
}
void ExtractionGui::startArchitecture() {
ARCHITECTURE::DialogModify* dialog = new ARCHITECTURE::DialogModify();
dialog->exec();
delete dialog;
}
} // namespace EXTRACTION
} // namespace CGA
Node-path: trunk/cga/extraction/extractiongui.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 431
Text-content-md5: 54c21739c12ca999e3b839462c551a3f
Content-length: 441
PROPS-END
#ifndef EXTRACTION_H
#define EXTRACTION_H
#include "uic/extractionguiui.h"
#include
#include
namespace CGA {
namespace EXTRACTION {
/**
* ExtractionGui
*/
class ExtractionGui : public ExtractionGuiUI {
Q_OBJECT
public:
ExtractionGui(QFrame*);
public slots:
void startArchitecture();
private:
};
} // namespace EXTRACTION
} // namespace CGA
#endif // EXTRACTION_H
Node-path: trunk/cga/extraction/extractionguiui.ui
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1888
Text-content-md5: 85cb2170388c5ced70808ab8433a8e89
Content-length: 1898
PROPS-END
ExtractionGuiUI
ExtractionGuiUI
0
0
424
86
ExtractionGuiUI
unnamed
pushButtonArchitecture
0
0
0
0
start
textLabel1
Create new or modify existing architecture model
pushButtonArchitecture
clicked()
ExtractionGuiUI
startArchitecture()
startArchitecture()
Node-path: trunk/cga/extraction/mapping
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/extraction/repository
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/main.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 652
Text-content-md5: 898f8652b04cb3239eca02889e82d459
Content-length: 662
PROPS-END
#include
#include
#include
#include "project/uic/projectgui.h"
#include "exception.h"
/**
* Entry point
*/
int main(int argc, char** argv) {
QApplication* app = new QApplication( argc, argv );
if (!QGLFormat::hasOpenGL()) {
QMessageBox::warning(NULL, "OpenGL error", "This system has no OpenGL support. Exiting.");
return -1;
}
ProjectGui* gui = new ProjectGui();
gui->show();
app->setMainWidget(gui);
int ret;
try {
ret = app->exec();
}
catch (CGA::Exception* e) {
QMessageBox::warning(NULL, "Exception thrown", e->getMessage());
return -2;
}
return ret;
}
Node-path: trunk/cga/project
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/project/controller.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 2590
Text-content-md5: 7e62515207bc0bb7acab629c61001db4
Content-length: 2600
PROPS-END
#include "../config.h"
#include "controller.h"
#include "dialognewproject.h"
#include "uic/projectgui.h"
#include "../extraction/extractiongui.h"
#include
#include
#include
#include
#include
#include
namespace CGA {
namespace PROJECT {
Controller* Controller::instance_ = NULL;
Controller::Controller() :
guiMenuBar_(NULL),
guiWidgetStack_(NULL),
guiFrameNoProject_(NULL),
guiFrameExtraction_(NULL),
guiFrameExploration_(NULL),
mode_(UNDEF)
{
}
Controller* Controller::instance() {
if (!instance_) instance_ = new Controller();
return instance_;
}
void Controller::registerProjectGui(
QMenuBar* menu,
QWidgetStack* widgetStack,
QFrame* noproject,
QFrame* extraction,
QFrame* exploration) {
guiMenuBar_ = menu;
guiWidgetStack_ = widgetStack;
guiFrameNoProject_ = noproject;
guiFrameExtraction_ = extraction;
guiFrameExploration_ = exploration;
QGridLayout* layout = new QGridLayout(guiFrameExtraction_, 3, 3, 0, 3);
EXTRACTION::ExtractionGui* extractionGui = new EXTRACTION::ExtractionGui(guiFrameExtraction_);
layout->addWidget(extractionGui, 1, 1);
// TODO: add widget for call graph exploration
//layout = new QGridLayout(guiFrameExploration_, 3, 3, 0, 3);
//EXTRACTION::ExplorationGui* explorationGui = new EXTRACTION::ExtractionGui(guiFrameExploration_);
//layout->addWidget(explorationGui, 1, 1);
setMode(NOPROJECT);
}
void Controller::destroy() {
// FIXME: disconnect from database
}
void Controller::modeExtraction() {
setMode(EXTRACTION);
}
void Controller::modeExploration() {
setMode(EXPLORATION);
}
void Controller::newProject() {
DialogNewProject* dialog = new DialogNewProject();
dialog->exec();
int result = dialog->result();
delete dialog;
if (result == QDialog::Accepted) {
guiMenuBar_->setItemEnabled(3, true);
guiMenuBar_->setItemEnabled(4, true);
}
}
void Controller::openProject() {
PRINT("openProject");
}
void Controller::setMode(Mode mode) {
if (mode == NOPROJECT && mode_ != NOPROJECT) {
guiMenuBar_->setItemEnabled(3, false);
guiMenuBar_->setItemEnabled(4, false);
guiWidgetStack_->raiseWidget(0);
} else if (mode == EXTRACTION && mode_ != EXTRACTION) {
guiWidgetStack_->raiseWidget(1);
} else if (mode == EXPLORATION && mode_ != EXPLORATION) {
guiWidgetStack_->raiseWidget(2);
}
mode_ = mode;
}
void Controller::foo() {
PRINT("Controller::foo()");
}
} //namespace PROJECT
} // namespace CGA
Node-path: trunk/cga/project/controller.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 955
Text-content-md5: df5e979e81a41a61856a93cc2ee4cd8a
Content-length: 965
PROPS-END
#ifndef PROJECT_CONTROLLER_H
#define PROJECT_CONTROLLER_H
#include
#include
#include
namespace CGA {
namespace PROJECT {
/**
* Controller
*/
class Controller : public QObject {
Q_OBJECT
public:
static Controller* instance();
void registerProjectGui(QMenuBar* menu, QWidgetStack* widgetStack, QFrame* noproject, QFrame* extraction, QFrame* exploration);
void destroy();
public slots:
void modeExtraction();
void modeExploration();
void newProject();
void openProject();
void foo();
private:
enum Mode {UNDEF, NOPROJECT, EXTRACTION, EXPLORATION};
Controller();
void setMode(Mode);
static Controller* instance_;
QMenuBar* guiMenuBar_;
QWidgetStack* guiWidgetStack_;
QFrame* guiFrameNoProject_;
QFrame* guiFrameExtraction_;
QFrame* guiFrameExploration_;
Mode mode_;
};
} //namespace PROJECT
} // namespace CGA
#endif //PROJECT_CONTROLLER_H
Node-path: trunk/cga/project/projectgui.ui
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 7499
Text-content-md5: 4b22c87b56314fd5d73f95e41f0cfddc
Content-length: 7509
PROPS-END
ProjectGui
ProjectGui
0
0
971
904
3
3
0
0
21
172
CGA - Call Graph Analyzer
unnamed
widgetStack
WStackPage
0
unnamed
frameNoProject
StyledPanel
Raised
WStackPage
1
unnamed
frameExtraction
StyledPanel
Raised
WStackPage
2
unnamed
frameExploration
StyledPanel
Raised
MenuBar
true
-
-
-
projectNewAction
New
&New
Ctrl+N
projectOpenAction
Open
&Open...
Ctrl+O
projectExitAction
Exit
E&xit
fooFooAction
&Foo
modeData_ExtractionAction
Data &Extraction
modeData_ExplorationAction
Data E&xploration
projectExitAction
activated()
ProjectGui
close()
projectgui.ui.h
init()
destroy()
Node-path: trunk/cga/project/projectgui.ui.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1358
Text-content-md5: 07cb1535c7043ca28f4908f6ddd0e0fd
Content-length: 1368
PROPS-END
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** Qt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/
#include "controller.h"
void ProjectGui::init()
{
qWarning("init GUI ...");
CGA::PROJECT::Controller* instance = CGA::PROJECT::Controller::instance();
instance->registerProjectGui(MenuBar, widgetStack, frameNoProject, frameExtraction, frameExploration);
// signals and slots connections
connect(projectOpenAction, SIGNAL(activated()), instance, SLOT(openProject()));
connect(projectNewAction, SIGNAL(activated()), instance, SLOT(newProject()));
connect(fooFooAction, SIGNAL(activated()), instance, SLOT(foo()));
connect(modeData_ExtractionAction, SIGNAL(activated()), instance, SLOT(modeExtraction()));
connect(modeData_ExplorationAction, SIGNAL(activated()), instance, SLOT(modeExploration()));
}
void ProjectGui::destroy()
{
qWarning("destroy GUI, disconnect from data base...");
CGA::PROJECT::Controller::instance()->destroy();
}
Node-path: trunk/cga/storage
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/xmlutil.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 267
Text-content-md5: 461b10189c858c979fdbf28ad42edfab
Content-length: 277
PROPS-END
#include "xmlutil.h"
namespace CGA {
QString XMLUtil::transcode(const XMLCh* const chars) {
QString result;
char* temp = xercesc::XMLString::transcode(chars);
result = temp;
xercesc::XMLString::release(&temp);
return result;
}
} // namespace CGA
Node-path: trunk/cga/xmlutil.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 381
Text-content-md5: 13f3e53d3bf8d5b47e41778e0f68143f
Content-length: 391
PROPS-END
#ifndef XMLUTIL_H
#define XMLUTIL_H
#include
#include
namespace CGA {
/**
* This is a simple class providing easy (though not terribly
* efficient) trancoding of XMLCh data to QString data.
*/
class XMLUtil {
public:
static QString transcode(const XMLCh* const chars);
};
} // namespace CGA
#endif // XMLUTIL_H
Node-path: trunk/cga.sln
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1043
Text-content-md5: a398556dda44bbbc60e9722da6efeb93
Content-length: 1053
PROPS-END
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cga", "cga\cga.vcproj", "{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug.ActiveCfg = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug.Build.0 = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release.ActiveCfg = Release|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
Node-path: trunk/simple_arch.xml
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 867
Text-content-md5: 77e1d962f7d0e47a68874ccef6a11bd3
Content-length: 877
PROPS-END
Revision-number: 8
Prop-content-length: 156
Content-length: 156
K 7
svn:log
V 45
remove annotation library for initial version
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T11:15:33.606555Z
PROPS-END
Node-path: trunk/cga/cga.vcproj
Node-kind: file
Node-action: change
Text-content-length: 18922
Text-content-md5: 2a016b35956956750f8fa5f04472131d
Content-length: 18922
Node-path: trunk/cga/project/controller.cpp
Node-kind: file
Node-action: change
Text-content-length: 2454
Text-content-md5: 564254fea6a814cd3b5268331e41eb26
Content-length: 2454
#include "../config.h"
#include "controller.h"
#include "uic/projectgui.h"
#include "../extraction/extractiongui.h"
#include
#include
#include
#include
#include
#include
namespace CGA {
namespace PROJECT {
Controller* Controller::instance_ = NULL;
Controller::Controller() :
guiMenuBar_(NULL),
guiWidgetStack_(NULL),
guiFrameNoProject_(NULL),
guiFrameExtraction_(NULL),
guiFrameExploration_(NULL),
mode_(UNDEF)
{
}
Controller* Controller::instance() {
if (!instance_) instance_ = new Controller();
return instance_;
}
void Controller::registerProjectGui(
QMenuBar* menu,
QWidgetStack* widgetStack,
QFrame* noproject,
QFrame* extraction,
QFrame* exploration) {
guiMenuBar_ = menu;
guiWidgetStack_ = widgetStack;
guiFrameNoProject_ = noproject;
guiFrameExtraction_ = extraction;
guiFrameExploration_ = exploration;
QGridLayout* layout = new QGridLayout(guiFrameExtraction_, 3, 3, 0, 3);
EXTRACTION::ExtractionGui* extractionGui = new EXTRACTION::ExtractionGui(guiFrameExtraction_);
layout->addWidget(extractionGui, 1, 1);
// TODO: add widget for call graph exploration
//layout = new QGridLayout(guiFrameExploration_, 3, 3, 0, 3);
//EXTRACTION::ExplorationGui* explorationGui = new EXTRACTION::ExtractionGui(guiFrameExploration_);
//layout->addWidget(explorationGui, 1, 1);
setMode(NOPROJECT);
}
void Controller::destroy() {
// FIXME: disconnect from database
}
void Controller::modeExtraction() {
setMode(EXTRACTION);
}
void Controller::modeExploration() {
setMode(EXPLORATION);
}
void Controller::newProject() {
PRINT("new project: dummy impl");
guiMenuBar_->setItemEnabled(3, true);
guiMenuBar_->setItemEnabled(4, true);
setMode(EXTRACTION);
}
void Controller::openProject() {
PRINT("openProject");
}
void Controller::setMode(Mode mode) {
if (mode == NOPROJECT && mode_ != NOPROJECT) {
guiMenuBar_->setItemEnabled(3, false);
guiMenuBar_->setItemEnabled(4, false);
guiWidgetStack_->raiseWidget(0);
} else if (mode == EXTRACTION && mode_ != EXTRACTION) {
guiWidgetStack_->raiseWidget(1);
} else if (mode == EXPLORATION && mode_ != EXPLORATION) {
guiWidgetStack_->raiseWidget(2);
}
mode_ = mode;
}
void Controller::foo() {
PRINT("Controller::foo()");
}
} //namespace PROJECT
} // namespace CGA
Revision-number: 9
Prop-content-length: 127
Content-length: 127
K 7
svn:log
V 16
Initial revision
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T11:22:14.725947Z
PROPS-END
Node-path: tags/cga-0.1-060918
Node-kind: dir
Node-action: add
Node-copyfrom-rev: 8
Node-copyfrom-path: trunk
Revision-number: 10
Prop-content-length: 119
Content-length: 119
K 7
svn:log
V 11
Test-Commit
K 10
svn:author
V 12
Stefan_Voigt
K 8
svn:date
V 27
2006-09-18T11:39:07.752517Z
PROPS-END
Node-path: trunk/cga/extraction/architecture/dialogmodify.cpp
Node-kind: file
Node-action: change
Text-content-length: 415
Text-content-md5: 4b689ae23f17c9e9d24fe6dc3055bd6e
Content-length: 415
#include "../../config.h"
#include "dialogmodify.h"
#include "dialogcreate.h"
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
DialogModify::DialogModify() :
DialogModifyGUI(NULL, "", true)
{
}
void DialogModify::foo() {
DialogCreate* dialog = new DialogCreate();
dialog->exec();
delete dialog;
}
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
Node-path: trunk/cga/extraction/architecture/dialogmodify.h
Node-kind: file
Node-action: change
Text-content-length: 479
Text-content-md5: be826307158a16feea26bf14048a8d6a
Content-length: 479
#ifndef EXTRACION_ARCHITECTURE_DIALOGMODIFY_H
#define EXTRACION_ARCHITECTURE_DIALOGMODIFY_H
#include "uic/dialogmodifygui.h"
namespace CGA {
namespace EXTRACTION {
namespace ARCHITECTURE {
/**
*
*/
class DialogModify : public DialogModifyGUI {
Q_OBJECT
public:
DialogModify();
public slots:
void foo();
private:
};
} //namespace ARCHITECTURE
} //namespace EXTRACTION
} // namespace CGA
#endif // EXTRACION_ARCHITECTURE_DIALOGMODIFY_H
Revision-number: 11
Prop-content-length: 197
Content-length: 197
K 7
svn:log
V 86
projectmodel added
gui for new, open, close project added
database communication added
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-18T14:03:22.355982Z
PROPS-END
Node-path: trunk/HOWTO-postgresql.txt
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 842
Text-content-md5: 267f15721e4cf8acc1f67fffa5a5a7db
Content-length: 852
PROPS-END
Installation:
-------------
Installation instructions for PostgreSQL are found here:
http://www.postgresql.org/docs/8.1/interactive/installation.html
Afterwards, a database server is running on port 5432 and an initial database named "postgres" is created.
Now PostgreSQL needs to be configured for working with CGA:
-------------------------------------------------------------------
1) Change method access for local users (-> 127.0.0.1/32) to "password". Standard was md5.
For this, you need to edit the "data/pg_hba.conf" file in the PostgreSQL installation directory.
2) Create a user called "cga" with password "cga".
For this, use the command line tool "createuser":
createuser -Upostgres -S -d -R -P cga
You need to type in the "cga" password twice and the password for the superuser "postgres" once.
Node-path: trunk/cga/cga.vcproj
Node-kind: file
Node-action: change
Text-content-length: 26177
Text-content-md5: 679549604604dedf98d8d476a0d0eb16
Content-length: 26177
Node-path: trunk/cga/exception.cpp
Node-kind: file
Node-action: change
Text-content-length: 629
Text-content-md5: c44837602cde11058de99da710ec3c08
Content-length: 629
#include "exception.h"
namespace CGA {
Exception::Exception(const QString msg)
: message_(msg)
{
}
QString Exception::getMessage() {
return message_;
}
FileException::FileException(const QString msg)
: Exception(msg)
{
}
DatabaseException::DatabaseException(const QString msg)
: Exception(msg)
{
}
DatabaseAlreadyExistsException::DatabaseAlreadyExistsException(const QString msg)
: DatabaseException(msg)
{
}
XMLException::XMLException(const QString msg)
: Exception(msg)
{
}
TraceFileException::TraceFileException(const QString msg)
: Exception(msg)
{
}
} // namespace CGA
Node-path: trunk/cga/exception.h
Node-kind: file
Node-action: change
Text-content-length: 1135
Text-content-md5: d918df12e29c7e1584669fc9a318a0e4
Content-length: 1135
#ifndef EXCEPTION_H
#define EXCEPTION_H
#include
namespace CGA {
/**
* Base class for Exceptions
*/
class Exception {
public:
Exception(const QString msg = "");
QString getMessage();
private:
QString message_;
};
/**
* Exception handling file errors
*/
class FileException : public Exception {
public:
FileException(const QString msg = "");
};
/**
* Exception handling database errors
*/
class DatabaseException : public Exception {
public:
DatabaseException(const QString msg = "");
};
/**
* Exception handling database error, that occurs if trying to create a database that already exists
*/
class DatabaseAlreadyExistsException : public DatabaseException {
public:
DatabaseAlreadyExistsException(const QString msg = "");
};
/**
* Exception handling XML errors
*/
class XMLException : public Exception {
public:
XMLException(const QString msg = "");
};
/**
* Exception handling TraceFile errors
*/
class TraceFileException : public Exception {
public:
TraceFileException(const QString msg = "");
};
} // namespace CGA
#endif // EXCEPTION_H
Node-path: trunk/cga/project/controller.cpp
Node-kind: file
Node-action: change
Text-content-length: 2637
Text-content-md5: be95f40008a37449aa8edb772015f0ce
Content-length: 2637
#include "../config.h"
#include "controller.h"
#include "dialognewproject.h"
#include "dialogopenproject.h"
#include "projectmodel.h"
#include "uic/projectgui.h"
#include "../extraction/extractiongui.h"
#include "../storage/databasewrapper.h"
#include
// for debugging purposes
#include "../extraction/architecture/dialogmodify.h"
using VRS::SO;
namespace CGA {
namespace PROJECT {
Controller* Controller::instance_ = NULL;
Controller::Controller() :
projectGui_(NULL),
mode_(UNDEF)
{
}
Controller* Controller::instance() {
if (!instance_) instance_ = new Controller();
return instance_;
}
void Controller::destroyController() {
STORAGE::DatabaseWrapper::disconnectDB();
if (instance_) delete instance_;
}
void Controller::registerProjectGui(ProjectGui* projectGui)
{
projectGui_ = projectGui;
QFrame* frame = projectGui_->getFrameExtraction();
QGridLayout* layout = new QGridLayout(frame, 3, 3, 0, 3);
EXTRACTION::ExtractionGui* extractionGui = new EXTRACTION::ExtractionGui(frame);
layout->addWidget(extractionGui, 1, 1);
setMode(NOPROJECT);
}
void Controller::modeExtraction() {
setMode(EXTRACTION);
}
void Controller::modeExploration() {
setMode(EXPLORATION);
}
void Controller::newProject() {
closeProject();
DialogNewProject* dialog = new DialogNewProject();
SO model = dialog->createNewProject();
if (model != NULL) {
projectGui_->setCaption("CGA - Call Graph Analyzer : " + model->getProjectName());
setMode(EXTRACTION);
}
}
void Controller::openProject() {
closeProject();
DialogOpenProject* dialog = new DialogOpenProject();
SO model = dialog->openProject();
if (model != NULL) {
projectGui_->setCaption("CGA - Call Graph Analyzer : " + model->getProjectName());
setMode(EXPLORATION);
}
}
void Controller::closeProject() {
STORAGE::DatabaseWrapper::disconnectDB();
setMode(NOPROJECT);
}
void Controller::setMode(Mode mode) {
if (mode == NOPROJECT && mode_ != NOPROJECT) {
projectGui_->setCaption("CGA - Call Graph Analyzer : no project");
projectGui_->setMode(0 /*no project*/);
} else if (mode == EXTRACTION && mode_ != EXTRACTION) {
projectGui_->setMode(1 /*extraction*/);
} else if (mode == EXPLORATION && mode_ != EXPLORATION) {
projectGui_->setMode(2 /*exploration*/);
}
mode_ = mode;
}
void Controller::foo() {
PRINT("Controller::foo()");
EXTRACTION::ARCHITECTURE::DialogModify* dialog = new EXTRACTION::ARCHITECTURE::DialogModify();
dialog->exec();
delete dialog;
}
} //namespace PROJECT
} // namespace CGA
Node-path: trunk/cga/project/controller.h
Node-kind: file
Node-action: change
Text-content-length: 802
Text-content-md5: 1091b46f75566c363d2a6a54d8096c1a
Content-length: 802
#ifndef PROJECT_CONTROLLER_H
#define PROJECT_CONTROLLER_H
#include
#include
#include
class ProjectGui;
namespace CGA {
namespace PROJECT {
/**
* Controller
*/
class Controller : public QObject {
Q_OBJECT
public:
static Controller* instance();
static void destroyController();
void registerProjectGui(ProjectGui*);
public slots:
void modeExtraction();
void modeExploration();
void newProject();
void openProject();
void closeProject();
void foo();
private:
enum Mode {UNDEF, NOPROJECT, EXTRACTION, EXPLORATION};
Controller();
void setMode(Mode);
static Controller* instance_;
ProjectGui* projectGui_;
Mode mode_;
};
} //namespace PROJECT
} // namespace CGA
#endif //PROJECT_CONTROLLER_H
Node-path: trunk/cga/project/dialognewproject.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 2340
Text-content-md5: 3692b5a866df8397772a97045aa3e5b1
Content-length: 2350
PROPS-END
#include "../config.h"
#include "dialognewproject.h"
#include "projectmodel.h"
#include "../storage/extraction/databaseinitializer.h"
#include "../exception.h"
#include
#include
#include
#include
#include
using VRS::SO;
namespace CGA {
namespace PROJECT {
const QString DialogNewProject::CGAUSER = "cga";
const QString DialogNewProject::CGAPASS = "cga";
DialogNewProject::DialogNewProject() :
DialogNewProjectGUI(NULL, "", true)
{
QRegExp exp("^[a-z][a-z0-9]{0,32}$");
lineEditName->setValidator(new QRegExpValidator(exp, this));
QRegExp exp2("^[0-9]{1,6}$");
lineEditPort->setValidator(new QRegExpValidator(exp2, this));
// default values
lineEditHost->setText("localhost");
lineEditPort->setText("5432");
}
VRS::SO DialogNewProject::createNewProject() {
exec();
if (result() == Rejected)
return NULL;
// else
SO model = new ProjectModel(
lineEditName->text(),
lineEditFolder->text(),
lineEditHost->text(),
lineEditPort->text().toUInt(),
CGAUSER,
CGAPASS);
return model;
}
void DialogNewProject::folder() {
QString dir = QFileDialog::getExistingDirectory(
QDir::currentDirPath(),
this,
"getDirDialog",
"Choose project folder");
if (dir == QString::null)
return;
lineEditFolder->setText(dir);
}
void DialogNewProject::ok() {
if (lineEditFolder->text().isEmpty() ||
lineEditName->text().isEmpty() ||
lineEditHost->text().isEmpty() ||
lineEditPort->text().isEmpty())
{
QMessageBox::information(this, "Information missing", "Fill out all fields.");
return;
}
try {
STORAGE::EXTRACTION::DatabaseInitializer::createAndInitialize(
lineEditName->text(),
lineEditHost->text(),
lineEditPort->text().toUInt(),
CGAUSER,
CGAPASS);
}
catch (DatabaseAlreadyExistsException* ) {
QMessageBox::information(this, "Database error", "Database named '"+lineEditName->text()+"' already exists.\nChoose a different name.");
return;
}
catch (DatabaseException* e) {
QMessageBox::information(this, "Database error", "Database error:\n"+ e->getMessage());
return;
}
accept();
}
void DialogNewProject::cancel() {
reject();
}
} //namespace PROJECT
} // namespace CGA
Node-path: trunk/cga/project/dialognewproject.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 614
Text-content-md5: 651ffa466e9edf38dfd6d42366ab90da
Content-length: 624
PROPS-END
#ifndef PROJECT_DIALOGNEWPROJECT_H
#define PROJECT_DIALOGNEWPROJECT_H
#include "uic/dialognewprojectgui.h"
#include
namespace CGA {
namespace PROJECT {
class ProjectModel;
/**
* DialogNewProject
*/
class DialogNewProject : public DialogNewProjectGUI {
Q_OBJECT
public:
DialogNewProject();
VRS::SO createNewProject();
public slots:
void folder();
void ok();
void cancel();
private:
static const QString CGAUSER;
static const QString CGAPASS;
};
} //namespace EXTRACTION
} // namespace CGA
#endif // PROJECT_DIALOGNEWPROJECT_H
Node-path: trunk/cga/project/dialognewprojectgui.ui
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 11667
Text-content-md5: b3d1923b617075724066d14d35f78545
Content-length: 11677
PROPS-END
DialogNewProjectGUI
DialogNewProjectGUI
0
0
331
277
5
5
0
0
New Project
unnamed
3
textLabel1
5
0
0
0
project settings
textLabel7
0
5
0
0
port
textLabel6
0
5
0
0
host
toolButtonFolder
0
0
0
0
StrongFocus
...
textLabel3
0
5
0
0
name
lineEditName
LineEditPanel
Sunken
textLabel4
0
5
0
0
folder
lineEditFolder
NoFocus
true
lineEditHost
lineEditPort
line2
HLine
Sunken
Horizontal
spacer3
Horizontal
Expanding
170
21
pushButtonOK
0
0
0
0
OK
pushButtonCancel
0
0
0
0
Cancel
spacer1
Horizontal
Expanding
32000
20
line1
HLine
Sunken
Horizontal
textLabel2
5
0
0
0
database server settings
spacer2
Horizontal
Expanding
170
20
pushButtonCancel
clicked()
DialogNewProjectGUI
cancel()
pushButtonOK
clicked()
DialogNewProjectGUI
ok()
toolButtonFolder
clicked()
DialogNewProjectGUI
folder()
lineEditName
toolButtonFolder
lineEditHost
lineEditPort
pushButtonOK
pushButtonCancel
lineEditFolder
ok()
cancel()
folder()
Node-path: trunk/cga/project/dialogopenproject.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1339
Text-content-md5: 470974d520a6d6ed736204d14c887715
Content-length: 1349
PROPS-END
#include "../config.h"
#include "dialogopenproject.h"
#include "projectmodel.h"
#include "../storage/extraction/databaseinitializer.h"
#include "../exception.h"
#include
#include
#include
using VRS::SO;
namespace CGA {
namespace PROJECT {
DialogOpenProject::DialogOpenProject() :
DialogOpenProjectGUI(NULL, "", true)
{
}
VRS::SO DialogOpenProject::openProject() {
exec();
if (result() == Rejected)
return NULL;
// else
SO model = NULL;
try {
model = ProjectModel::loadFromXML(lineEditFile->text());
}
catch (Exception*) {
QMessageBox::information(this, "Open error", "No valid 'project.xml' file found.");
return NULL;
}
return model;
}
void DialogOpenProject::file() {
QString file = QFileDialog::getOpenFileName(
QDir::currentDirPath(),
"Project (project.xml)",
this,
"openFileDialog",
"Choose project file");
if (file == QString::null)
return;
lineEditFile->setText(file);
}
void DialogOpenProject::ok() {
if (lineEditFile->text().isEmpty())
{
QMessageBox::information(this, "Information missing", "Please choose project file.");
return;
}
accept();
}
void DialogOpenProject::cancel() {
reject();
}
} //namespace PROJECT
} // namespace CGA
Node-path: trunk/cga/project/dialogopenproject.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 551
Text-content-md5: a5ff891cf4643125c99c35d5140ae6f9
Content-length: 561
PROPS-END
#ifndef PROJECT_DIALOGOPENPROJECT_H
#define PROJECT_DIALOGOPENPROJECT_H
#include "uic/dialogopenprojectgui.h"
#include
namespace CGA {
namespace PROJECT {
class ProjectModel;
/**
* DialogOpenProject
*/
class DialogOpenProject : public DialogOpenProjectGUI {
Q_OBJECT
public:
DialogOpenProject();
VRS::SO openProject();
public slots:
void file();
void ok();
void cancel();
private:
};
} //namespace EXTRACTION
} // namespace CGA
#endif // PROJECT_DIALOGOPENPROJECT_H
Node-path: trunk/cga/project/dialogopenprojectgui.ui
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 5558
Text-content-md5: 0a46e8363d037f33c181a0bc7124454e
Content-length: 5568
PROPS-END
DialogOpenProjectGUI
DialogOpenProjectGUI
0
0
358
70
5
5
0
0
Open Project
unnamed
3
textLabel3
0
5
0
0
project xml file
spacer1
Horizontal
Expanding
32000
20
lineEditFile
LineEditPanel
Sunken
true
pushButtonOK
0
0
0
0
OK
pushButtonCancel
0
0
0
0
Cancel
toolButtonFile
0
0
0
0
StrongFocus
...
toolButtonFile
clicked()
DialogOpenProjectGUI
file()
pushButtonOK
clicked()
DialogOpenProjectGUI
ok()
pushButtonCancel
clicked()
DialogOpenProjectGUI
cancel()
lineEditFile
toolButtonFile
pushButtonOK
pushButtonCancel
ok()
cancel()
file()
Node-path: trunk/cga/project/projectgui.ui
Node-kind: file
Node-action: change
Text-content-length: 8036
Text-content-md5: e826cdf78e9695567a425d6f41af1e85
Content-length: 8036
ProjectGui
ProjectGui
0
0
971
919
3
3
0
0
21
196
CGA - Call Graph Analyzer
unnamed
widgetStack
WStackPage
0
unnamed
frameNoProject
StyledPanel
Raised
WStackPage
1
unnamed
frameExtraction
StyledPanel
Raised
WStackPage
2
unnamed
frameExploration
StyledPanel
Raised
MenuBar
true
-
-
-
projectNewAction
New
&New
Ctrl+N
projectOpenAction
Open
&Open...
Ctrl+O
projectExitAction
Exit
E&xit
fooFooAction
&Foo
modeData_ExtractionAction
Data &Extraction
modeData_ExplorationAction
Data E&xploration
projectCloseAction
&Close
projectExitAction
activated()
ProjectGui
close()
projectgui.ui.h
init()
destroy()
setMode(int)
getFrameNoProject()
getFrameExtraction()
getFrameExploration()
Node-path: trunk/cga/project/projectgui.ui.h
Node-kind: file
Node-action: change
Text-content-length: 2319
Text-content-md5: fcc0818a7ca728832496c1f4b5f2f426
Content-length: 2319
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** Qt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/
#include "controller.h"
void ProjectGui::init()
{
qWarning("init GUI ...");
CGA::PROJECT::Controller* instance = CGA::PROJECT::Controller::instance();
instance->registerProjectGui(this);
// signals and slots connections
connect(projectNewAction, SIGNAL(activated()), instance, SLOT(newProject()));
connect(projectOpenAction, SIGNAL(activated()), instance, SLOT(openProject()));
connect(projectCloseAction, SIGNAL(activated()), instance, SLOT(closeProject()));
connect(fooFooAction, SIGNAL(activated()), instance, SLOT(foo()));
connect(modeData_ExtractionAction, SIGNAL(activated()), instance, SLOT(modeExtraction()));
connect(modeData_ExplorationAction, SIGNAL(activated()), instance, SLOT(modeExploration()));
}
void ProjectGui::destroy()
{
qWarning("destroy GUI, disconnect from data base...");
CGA::PROJECT::Controller::destroyController();
}
QFrame* ProjectGui::getFrameNoProject()
{
return frameNoProject;
}
QFrame* ProjectGui::getFrameExtraction()
{
return frameExtraction;
}
QFrame* ProjectGui::getFrameExploration()
{
return frameExploration;
}
/*! mode==0: no project
* mode==1: extraction mode
* mode==2: exploration mode
*/
void ProjectGui::setMode(int mode) {
widgetStack->raiseWidget(mode);
if (mode == 0) { // no project
projectCloseAction->setEnabled(false);
modeData_ExtractionAction->setEnabled(false);
modeData_ExplorationAction->setEnabled(false);
} else if (mode == 1) { // extraction mode
projectCloseAction->setEnabled(true);
modeData_ExtractionAction->setEnabled(true);
modeData_ExplorationAction->setEnabled(true);
} else if (mode == 2) { // exploration mode
projectCloseAction->setEnabled(true);
modeData_ExtractionAction->setEnabled(true);
modeData_ExplorationAction->setEnabled(true);
}
}
Node-path: trunk/cga/project/projectmodel.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 2847
Text-content-md5: a004456cf45b95873646743f0b9ad9d7
Content-length: 2857
PROPS-END
#include "../config.h"
#include "projectmodel.h"
#include "projectmodelxmlreader.h"
#include "../storage/databasewrapper.h"
#include "../exception.h"
#include "../xmlutil.h"
#include
#include
#include
#include
#include
using VRS::SO;
namespace CGA {
namespace PROJECT {
ProjectModel::ProjectModel(
QString projectName,
QString projectFolder,
QString databaseHost,
unsigned int databasePort,
QString databaseUser,
QString databasePass) :
projectName_(projectName),
projectFolder_(projectFolder),
databaseHost_(databaseHost),
databasePort_(databasePort),
databaseUser_(databaseUser),
databasePass_(databasePass)
{
init();
QDir::setCurrent(projectFolder_);
saveToXML();
}
void ProjectModel::init() {
}
void ProjectModel::saveToXML() {
QDir::setCurrent(projectFolder_);
// check file
QString file = "project.xml";
QFile f(file);
if (!f.open(IO_WriteOnly))
{
throw FileException("Can not open file for writing: " + file);
}
QTextStream stream(&f);
stream.precision(9);
//
// head
//
stream << "\n";
stream << "\n";
stream << "\n";
stream << "\n";
stream << "\n";
stream << "\n";
stream << "\n";
//
// close file
//
f.close();
}
VRS::SO ProjectModel::loadFromXML(QString file) {
QString projectName;
QString databaseHost;
unsigned int databasePort;
QString databaseUser;
QString databasePass;
QFileInfo info(file);
QString projectFolder = info.dirPath(true);
QDir::setCurrent(projectFolder);
SO model = NULL;
try {
ProjectModelXMLReader::read(
file,
&projectName,
&databaseHost,
&databasePort,
&databaseUser,
&databasePass);
model = new ProjectModel(
projectName,
projectFolder,
databaseHost,
databasePort,
databaseUser,
databasePass);
STORAGE::DatabaseWrapper::connectDB(
projectName,
databaseHost,
databasePort,
databaseUser,
databasePass);
}
catch (DatabaseException*) {
QMessageBox::information(NULL, "Database error", "Could not establish connection to database.");
return NULL;
}
return model;
}
} // namespace PROJECT
} // namespace CGA
Node-path: trunk/cga/project/projectmodel.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1025
Text-content-md5: 9c6e1ab897f41dc906ad21c0d128bb09
Content-length: 1035
PROPS-END
#ifndef PROJECT_PROJECTMODEL_H
#define PROJECT_PROJECTMODEL_H
#include
#include
namespace CGA {
namespace PROJECT {
/**
* ProjectModel
*/
class ProjectModel : public VRS::SharedObj {
public:
ProjectModel(
QString projectName,
QString projectFolder,
QString databaseHost,
unsigned int databasePort,
QString databaseUser,
QString databasePass);
/// throws Exception
void saveToXML();
static VRS::SO loadFromXML(QString file);
// ////////////////////////////////////////////////////////////////////////
// getter methods
// ////////////////////////////////////////////////////////////////////////
QString getProjectName() const {return projectName_;}
private:
void init();
QString projectName_;
QString projectFolder_;
QString databaseHost_;
unsigned int databasePort_;
QString databaseUser_;
QString databasePass_;
};
} // namespace PROJECT
} // namespace CGA
#endif //PROJECT_PROJECTMODEL_H
Node-path: trunk/cga/project/projectmodelxmlhandler.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 2619
Text-content-md5: fa412539a92a066a89f9407c39fee33f
Content-length: 2629
PROPS-END
#include "../config.h"
#include "projectmodelxmlhandler.h"
#include "../exception.h"
#include "../xmlutil.h"
#include
using VRS::SO;
namespace CGA {
namespace PROJECT {
ProjectModelXMLHandler::ProjectModelXMLHandler(
QString* outProjectName,
QString* outPatabaseHost,
unsigned int* outDatabasePort,
QString* outDatabaseUser,
QString* outDatabasePass) :
outProjectName_(outProjectName),
outPatabaseHost_(outPatabaseHost),
outDatabasePort_(outDatabasePort),
outDatabaseUser_(outDatabaseUser),
outDatabasePass_(outDatabasePass)
{
}
ProjectModelXMLHandler::~ProjectModelXMLHandler() {
}
void ProjectModelXMLHandler::endDocument() {
}
void ProjectModelXMLHandler::characters(const XMLCh* const chars, const unsigned int length) {
}
void ProjectModelXMLHandler::ignorableWhitespace(const XMLCh* const chars, const unsigned int length) {
}
void ProjectModelXMLHandler::processingInstruction(const XMLCh* const target, const XMLCh* const data) {
}
void ProjectModelXMLHandler::startDocument() {
}
void ProjectModelXMLHandler::endElement(const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname) {
}
void ProjectModelXMLHandler::startElement( const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname,
const xercesc::Attributes& attributes)
{
QString e = XMLUtil::transcode(localname);
if (e == "project") {
QString name = XMLUtil::transcode(attributes.getValue((unsigned int)0));
*outProjectName_ = name;
return;
}
if (e == "database") {
QString host = XMLUtil::transcode(attributes.getValue((unsigned int)0));
unsigned int port = XMLUtil::transcode(attributes.getValue((unsigned int)1)).toUInt();
QString user = XMLUtil::transcode(attributes.getValue((unsigned int)2));
QString pass = XMLUtil::transcode(attributes.getValue((unsigned int)3));
*outPatabaseHost_ = host;
*outDatabasePort_ = port;
*outDatabaseUser_ = user;
*outDatabasePass_ = pass;
return;
}
}
void ProjectModelXMLHandler::warning(const xercesc::SAXParseException& exc) {
throw XMLException("XML warning: " + XMLUtil::transcode(exc.getMessage()));
}
void ProjectModelXMLHandler::error(const xercesc::SAXParseException& exc) {
throw XMLException("XML error: " + XMLUtil::transcode(exc.getMessage()));
}
void ProjectModelXMLHandler::fatalError(const xercesc::SAXParseException& exc) {
throw XMLException("XML fatalError: " + XMLUtil::transcode(exc.getMessage()));
}
} // namespace PROJECT
} // namespace CGA
Node-path: trunk/cga/project/projectmodelxmlhandler.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1599
Text-content-md5: fb3d28c99d8834ad37d32f3a07e4df0d
Content-length: 1609
PROPS-END
#ifndef PROJECT_PROJECTMODELXMLHANDLER_H
#define PROJECT_PROJECTMODELXMLHANDLER_H
#include
#include
#include
namespace CGA {
namespace PROJECT {
/**
* ProjectModelXMLHandler is used by ProjectModelXMLReader to create an ProjectProjectModel from an XML file
*/
class ProjectModelXMLHandler : public xercesc::DefaultHandler {
public:
ProjectModelXMLHandler(
QString* outProjectName,
QString* outPatabaseHost,
unsigned int* outDatabasePort,
QString* outDatabaseUser,
QString* outDatabasePass);
virtual ~ProjectModelXMLHandler();
private:
void endDocument();
void endElement( const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname);
void characters(const XMLCh* const chars, const unsigned int length);
void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
void processingInstruction(const XMLCh* const target, const XMLCh* const data);
void startDocument();
void startElement( const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname,
const xercesc::Attributes& attributes);
void warning(const xercesc::SAXParseException& exc);
void error(const xercesc::SAXParseException& exc);
void fatalError(const xercesc::SAXParseException& exc);
private:
QString* outProjectName_;
QString* outPatabaseHost_;
unsigned int* outDatabasePort_;
QString* outDatabaseUser_;
QString* outDatabasePass_;
};
} // namespace PROJECT
} // namespace CGA
#endif // PROJECT_PROJECTMODELXMLHANDLER_H
Node-path: trunk/cga/project/projectmodelxmlreader.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1664
Text-content-md5: 091c254270c28e6e9f5f8a7f36f463a2
Content-length: 1674
PROPS-END
#include "../config.h"
#include "projectmodelxmlreader.h"
#include "projectmodelxmlhandler.h"
#include "../exception.h"
#include
#include
#include
#include
namespace CGA {
namespace PROJECT {
ProjectModelXMLReader::ProjectModelXMLReader() {
}
void ProjectModelXMLReader::read(
QString xmlfile,
QString* outProjectName,
QString* outPatabaseHost,
unsigned int* outDatabasePort,
QString* outDatabaseUser,
QString* outDatabasePass)
{
// check file
QFile f(xmlfile);
if (!f.exists() || !f.open(IO_ReadOnly))
{
throw FileException("Can not open file " + xmlfile);
}
// Initialize the XML4C2 system
try
{
xercesc::XMLPlatformUtils::Initialize();
}
catch (const xercesc::XMLException&)
{
throw XMLException("Can not initialize XML parser.");
}
xercesc::SAX2XMLReader* parser = xercesc::XMLReaderFactory::createXMLReader();
parser->setFeature(xercesc::XMLUni::fgSAX2CoreValidation, false);
parser->setFeature(xercesc::XMLUni::fgSAX2CoreNameSpaces, true);
parser->setFeature(xercesc::XMLUni::fgXercesSchema, false);
parser->setFeature(xercesc::XMLUni::fgXercesSchemaFullChecking, false);
parser->setFeature(xercesc::XMLUni::fgSAX2CoreNameSpacePrefixes, false);
ProjectModelXMLHandler handler(
outProjectName,
outPatabaseHost,
outDatabasePort,
outDatabaseUser,
outDatabasePass);
parser->setContentHandler(&handler);
parser->parse(xmlfile.ascii());
delete parser;
xercesc::XMLPlatformUtils::Terminate();
}
} // namespace PROJECT
} // namespace CGA
Node-path: trunk/cga/project/projectmodelxmlreader.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 707
Text-content-md5: 57054754353701b73e5a244cb1d4695c
Content-length: 717
PROPS-END
#ifndef PROJECT_PROJECTMODELXMLREADER_H
#define PROJECT_PROJECTMODELXMLREADER_H
#include
#include
namespace CGA {
namespace PROJECT {
class ProjectModel;
/**
* ProjectModelXMLReader has the static method read to create an ProjectModel from an XML file
*/
class ProjectModelXMLReader {
public:
// throws FileException, XMLException
static void read(
QString xmlfile,
QString* outProjectName,
QString* outPatabaseHost,
unsigned int* outDatabasePort,
QString* outDatabaseUser,
QString* outDatabasePass);
private:
ProjectModelXMLReader();
};
} // namespace PROJECT
} // namespace CGA
#endif // PROJECT_PROJECTMODELXMLREADER_H
Node-path: trunk/cga/storage/databasewrapper.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 3349
Text-content-md5: b4a3fdb31681e0be0b819bfbb9366b1f
Content-length: 3359
PROPS-END
#include "../config.h"
#include "databasewrapper.h"
#include "../exception.h"
using VRS::SO;
namespace CGA {
namespace STORAGE {
DatabaseWrapper* DatabaseWrapper::instance_ = NULL;
DatabaseWrapper* DatabaseWrapper::instance() {
if (!instance_)
throw new DatabaseException("Database is not connected");
return instance_;
}
void DatabaseWrapper::createDatabase(QString databasename,
QString host,
unsigned int port,
QString user,
QString pass)
{
QString conninfo("host="+host+" port="+QString::number(port)+" dbname=postgres user="+user+" password="+pass);
PGconn* conn = PQconnectdb(conninfo.ascii());
if (PQstatus(conn) != CONNECTION_OK) {
throw new DatabaseException("Connection to database postgres failed: " + QString(PQerrorMessage(conn)) + "\n" + conninfo);
}
QString cmd = "SELECT datname FROM pg_database;";
PGresult* res = PQexec(conn, cmd);
if (PQresultStatus(res) != PGRES_TUPLES_OK)
{
QString error = PQerrorMessage(conn);
PQclear(res);
throw new DatabaseException(error + "\n" + cmd);
}
int i, iMax = PQntuples(res);
for (i=0; iconn_) {
PQfinish(instance_->conn_);
instance_->conn_ = NULL;
}
delete instance_;
instance_ = NULL;
}
void DatabaseWrapper::execCommand(QString cmd) {
PGresult* res = PQexec(conn_, cmd);
if (PQresultStatus(res) != PGRES_COMMAND_OK) {
PQclear(res);
QString error = PQerrorMessage(conn_);
throw new DatabaseException(error + "\n" + cmd);
}
PQclear(res);
}
PGresult* DatabaseWrapper::execTupleCommand(QString cmd) {
// TODO: encapsulate results
//PGresult* res = PQexec(conn_, cmd);
//if (PQresultStatus(res) != PGRES_TUPLES_OK)
//{
// QString error = PQerrorMessage(conn_);
// PQclear(res);
// throw new DatabaseException(error + "\n" + cmd);
//}
//return res;
return NULL;
}
} // namespace STORAGE
} // namespace CGA
Node-path: trunk/cga/storage/databasewrapper.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1074
Text-content-md5: 9228f2c60822662f2fb9be0e45f9bd24
Content-length: 1084
PROPS-END
#ifndef STORAGE_DATABASEWRAPPER_H
#define STORAGE_DATABASEWRAPPER_H
#include
#include
#include
#include
namespace CGA {
namespace STORAGE {
/**
* DatabaseWrapper
*/
class DatabaseWrapper {
public:
static DatabaseWrapper* instance();
/// throws DatabaseException
static void createDatabase(
QString databasename,
QString host,
unsigned int port,
QString user,
QString pass);
/*! throws DatabaseException
* creates an instance of DatabaseWrapper that is accessible with instance()
*/
static void connectDB(
QString databasename,
QString host,
unsigned int port,
QString user,
QString pass);
static void disconnectDB();
void execCommand(QString cmd);
// FIXME: return result in an encapsulated way
PGresult* execTupleCommand(QString cmd);
private:
DatabaseWrapper();
static DatabaseWrapper* instance_;
PGconn* conn_;
};
} // namespace STORAGE
} // namespace CGA
#endif // STORAGE_DATABASEWRAPPER_H
Node-path: trunk/cga/storage/exploration
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/storage/extraction
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/cga/storage/extraction/databaseinitializer.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 3348
Text-content-md5: 2adbec3d14b104a61aae96cb22000150
Content-length: 3358
PROPS-END
#include "../../config.h"
#include "databaseinitializer.h"
using VRS::SO;
namespace CGA {
namespace STORAGE {
namespace EXTRACTION {
DatabaseInitializer::DatabaseInitializer() {
VRS_Error(false, "no instance");
}
void DatabaseInitializer::createAndInitialize(
QString databasename,
QString host,
unsigned int port,
QString user,
QString pass)
{
create(databasename, host, port, user, pass);
init(databasename, host, port, user, pass);
}
void DatabaseInitializer::create(
QString databasename,
QString host,
unsigned int port,
QString user,
QString pass)
{
DatabaseWrapper::createDatabase(
databasename,
host,
port,
user,
pass);
}
void DatabaseInitializer::init(
QString databasename,
QString host,
unsigned int port,
QString user,
QString pass)
{
DatabaseWrapper::connectDB(
databasename,
host,
port,
user,
pass);
QString cmd =
"CREATE TABLE fl2name (\
fl int8 not null primary key,\
name varchar(512) not null);\
CREATE INDEX fl2name_name_idx ON fl2name (name);\
CREATE TABLE elf2name (\
elf int8 not null primary key, \
name varchar(512) not null,\
issystemlib int not null,\
archcomp int8 not null);\
CREATE INDEX elf2name_name_idx ON elf2name (name);\
CREATE TABLE functions (\
fn int8 not null primary key,\
fl int8 not null REFERENCES fl2name (fl), \
elf int8 not null REFERENCES elf2name (elf),\
name varchar(512) not null,\
shortname varchar(512) not null);\
CREATE INDEX functions_name_idx ON functions (name);\
CREATE SEQUENCE idfn;\
CREATE SEQUENCE idfl;\
CREATE SEQUENCE idelf;\
CREATE SEQUENCE idarch;\
CREATE SEQUENCE idfeat;\
CREATE SEQUENCE idtrace;\
CREATE TABLE archcomps (\
comp int8 not null primary key,\
parent int8 REFERENCES archcomps (comp),\
name varchar(128),\
fullname varchar(512),\
hierarchydepth int);\
CREATE INDEX archcomps_comp_idx ON archcomps (comp);\
CREATE INDEX archcomps_parent_idx ON archcomps (parent);\
INSERT INTO archcomps(comp) VALUES (" + QString::number(UNDEF_ID) + ");\
CREATE TABLE archenv (\
type varchar(32) not null primary key,\
comp int8 not null REFERENCES archcomps (comp));\
INSERT INTO archenv VALUES ('undef', " + QString::number(UNDEF_ID) + ");\
CREATE TABLE archdirs (\
dir int8 not null primary key,\
parent int8 REFERENCES archdirs (dir),\
name varchar(128),\
comp int8 REFERENCES archcomps (comp));\
CREATE INDEX archdirs_dir_idx ON archdirs (dir);\
CREATE INDEX archdirs_parent_idx ON archdirs (parent);\
CREATE TABLE archdirenv (\
type varchar(32) not null primary key,\
dir int8 not null REFERENCES archdirs (dir));\
CREATE TABLE funcarchmapping (\
fn int8 not null primary key REFERENCES functions (fn),\
comp int8 not null);\
CREATE TABLE features (\
id int8 not null primary key,\
name varchar(128),\
description varchar(1024));\
CREATE TABLE traces (\
id int8 not null primary key,\
name varchar(128),\
description varchar(1024),\
featureid int8 REFERENCES features (id));\
CREATE INDEX traces_featureid_idx ON traces (featureid);\
";
DatabaseWrapper::instance()->execCommand(cmd);
}
} // namespace EXTRACTION
} // namespace STORAGE
} // namespace CGA
Node-path: trunk/cga/storage/extraction/databaseinitializer.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 851
Text-content-md5: ea0595872dc340f5e235aed7b119af47
Content-length: 861
PROPS-END
#ifndef STORAGE_EXTRACTION_DATABASEINITIALIZER_H
#define STORAGE_EXTRACTION_DATABASEINITIALIZER_H
#include "../databasewrapper.h"
namespace CGA {
namespace STORAGE {
namespace EXTRACTION {
/**
* DatabaseInitializer
*/
class DatabaseInitializer {
public:
static void createAndInitialize(
QString databasename,
QString host = "localhost",
unsigned int port = 5432,
QString user = "cga",
QString pass = "cga");
private:
DatabaseInitializer();
static void create(
QString databasename,
QString host,
unsigned int port,
QString user,
QString pass);
static void init(
QString databasename,
QString host,
unsigned int port,
QString user,
QString pass);
};
} // namespace EXTRACTION
} // namespace STORAGE
} // namespace CGA
#endif // STORAGE_EXTRACTION_DATABASEINITIALIZER_H
Node-path: trunk/cga/xmlutil.cpp
Node-kind: file
Node-action: change
Text-content-length: 840
Text-content-md5: 51e2e043a8a7d8ef18e07dd0a83cdb21
Content-length: 840
#include "xmlutil.h"
namespace CGA {
QString XMLUtil::transcode(const XMLCh* const chars) {
QString result;
char* temp = xercesc::XMLString::transcode(chars);
result = temp;
xercesc::XMLString::release(&temp);
return result;
}
QString XMLUtil::transformSpecialChars(std::string str) {
QString clean = str.c_str();
clean.replace(QChar('&'), "&");
clean.replace(QChar(39), "'");
clean.replace(QChar('<'), "<");
clean.replace(QChar('>'), ">");
clean.replace(QChar('"'), """);
clean.replace(QChar(''), "Ä");
clean.replace(QChar(''), "Ö");
clean.replace(QChar(''), "Ü");
clean.replace(QChar(''), "ä");
clean.replace(QChar(''), "ö");
clean.replace(QChar(''), "ü");
clean.replace(QChar(''), "ß");
return clean;
}
} // namespace CGA
Node-path: trunk/cga/xmlutil.h
Node-kind: file
Node-action: change
Text-content-length: 438
Text-content-md5: 3a79e8bfd5926febcc1b8746b3516588
Content-length: 438
#ifndef XMLUTIL_H
#define XMLUTIL_H
#include
#include
namespace CGA {
/**
* This is a simple class providing easy (though not terribly
* efficient) trancoding of XMLCh data to QString data.
*/
class XMLUtil {
public:
static QString transcode(const XMLCh* const chars);
static QString transformSpecialChars(std::string str);
};
} // namespace CGA
#endif // XMLUTIL_H
Node-path: trunk/environmentvars.txt
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 359
Text-content-md5: 0237cb9e1859f873bb733a12d1c6ac75
Content-length: 369
PROPS-END
Environment variables that need to be set:
------------------------------------------
VRS_HOME -> vrs-project includes&libs (www.vrs3d.org) [$(VRS_HOME)/include and $(VRS_HOME)/lib]
POSTGRESQL -> PostgreSQL database includes&libs (www.postgresql.org)
QTDIR -> qt3 includes&libs
XERCES_HOME -> Xerces XML-parser includes&libs (xml.apache.org/xerces-c)
Revision-number: 12
Prop-content-length: 144
Content-length: 144
K 7
svn:log
V 33
Support for MS Visual Studio 2005
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-20T09:40:38.392142Z
PROPS-END
Node-path: trunk/HOWTO-postgresql.txt
Node-kind: file
Node-action: change
Text-content-length: 998
Text-content-md5: 5a501ff30bbf774a13a05881e6692bc0
Content-length: 998
Installation:
-------------
Installation instructions for PostgreSQL are found here:
http://www.postgresql.org/docs/8.1/interactive/installation.html
Note, that you need to install the binary&configuration files to run the server AND include&library files to build CGA with PostgreSQL-support afterwards.
Afterwards, a database server is running on port 5432 and an initial database named "postgres" is created.
Now PostgreSQL needs to be configured for working with CGA:
-------------------------------------------------------------------
1) Change method access for local users (-> 127.0.0.1/32) to "password". Standard was md5.
For this, you need to edit the "data/pg_hba.conf" file in the PostgreSQL installation directory.
2) Create a user called "cga" with password "cga".
For this, use the command line tool "createuser":
createuser -Upostgres -S -d -R -P cga
You need to type in the "cga" password twice and the password for the superuser "postgres" once.
Node-path: trunk/cga/cga-vs2003.vcproj
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 26177
Text-content-md5: 679549604604dedf98d8d476a0d0eb16
Content-length: 26187
PROPS-END
Node-path: trunk/cga/cga-vs2005.vcproj
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 27915
Text-content-md5: 25c7722f609552beb0cd064da13b2b13
Content-length: 27925
PROPS-END
Node-path: trunk/cga/cga.vcproj
Node-action: delete
Node-path: trunk/cga-vs2003.sln
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 906
Text-content-md5: c70039f47f63d673944562740e439fa8
Content-length: 916
PROPS-END
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cga", "cga\cga-vs2003.vcproj", "{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug.ActiveCfg = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug.Build.0 = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release.ActiveCfg = Release|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
Node-path: trunk/cga-vs2005.sln
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 876
Text-content-md5: 650317e06fcc58bb9be613f6ce433943
Content-length: 886
PROPS-END
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cga", "cga\cga-vs2005.vcproj", "{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug|Win32.ActiveCfg = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug|Win32.Build.0 = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release|Win32.ActiveCfg = Release|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Node-path: trunk/cga.sln
Node-action: delete
Revision-number: 13
Prop-content-length: 110
Content-length: 110
K 7
svn:log
V 0
K 10
svn:author
V 15
Johannes_Bohnet
K 8
svn:date
V 27
2006-09-20T12:32:14.752632Z
PROPS-END
Node-path: trunk/cga/cga-vs2005.vcproj
Node-kind: file
Node-action: change
Text-content-length: 28349
Text-content-md5: add992924c8d2d3bf8540110e30f4b4d
Content-length: 28349
Node-path: trunk/cga-devel-example-bohnet.bat
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 402
Text-content-md5: 7b4292d1e7708481f0c9a1592bd2d86e
Content-length: 412
PROPS-END
SET CGA_HOME=e:\projects\cga
SET VRS_HOME=e:\projects\vrs
SET XERCES_HOME=e:\projects\ldx
SET POSTGRESQL=D:\programme\PostgreSQL\8.1
SET QTDIR=D:\programme\Qt\3.2.0Educational
SET FREETYPE_HOME=E:\projects\freetype-2.2.1
SET PATH=%VRS_HOME%/lib;%CGA_HOME%/vrs_anno/lib;%CGA_HOME%/vrs_text/bin;%PATH%
START "D:\programme\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" %CGA_HOME%\cga-vs2005.sln
Node-path: trunk/cga-vs2005.sln
Node-kind: file
Node-action: change
Text-content-length: 2648
Text-content-md5: fffcb9e08c78cb879e1859b51a9dbc36
Content-length: 2648
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cga", "cga\cga-vs2005.vcproj", "{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vrs_anno", "vrs_anno\win32\vrs_anno\vrs_anno.vcproj", "{2B65E11E-2CBD-4D5B-AECF-F51CC8DE911F}"
ProjectSection(ProjectDependencies) = postProject
{E151AA45-3477-4FC4-A94B-BA9D06AB3A54} = {E151AA45-3477-4FC4-A94B-BA9D06AB3A54}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vrs_text", "vrs_text\win32\vrs_text\vrs_text_vc8.vcproj", "{E151AA45-3477-4FC4-A94B-BA9D06AB3A54}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smartmaplabels_01", "vrs_anno\win32\smartmaplabels_01\smartmaplabels_01.vcproj", "{336BCEC8-E39F-4C47-8667-B976AE619654}"
ProjectSection(ProjectDependencies) = postProject
{2B65E11E-2CBD-4D5B-AECF-F51CC8DE911F} = {2B65E11E-2CBD-4D5B-AECF-F51CC8DE911F}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug|Win32.ActiveCfg = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Debug|Win32.Build.0 = Debug|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release|Win32.ActiveCfg = Release|Win32
{7AD904CF-C8F1-4E39-B5AF-FDC5BADB48B5}.Release|Win32.Build.0 = Release|Win32
{2B65E11E-2CBD-4D5B-AECF-F51CC8DE911F}.Debug|Win32.ActiveCfg = Debug|Win32
{2B65E11E-2CBD-4D5B-AECF-F51CC8DE911F}.Debug|Win32.Build.0 = Debug|Win32
{2B65E11E-2CBD-4D5B-AECF-F51CC8DE911F}.Release|Win32.ActiveCfg = Release|Win32
{2B65E11E-2CBD-4D5B-AECF-F51CC8DE911F}.Release|Win32.Build.0 = Release|Win32
{E151AA45-3477-4FC4-A94B-BA9D06AB3A54}.Debug|Win32.ActiveCfg = Debug|Win32
{E151AA45-3477-4FC4-A94B-BA9D06AB3A54}.Debug|Win32.Build.0 = Debug|Win32
{E151AA45-3477-4FC4-A94B-BA9D06AB3A54}.Release|Win32.ActiveCfg = Release|Win32
{E151AA45-3477-4FC4-A94B-BA9D06AB3A54}.Release|Win32.Build.0 = Release|Win32
{336BCEC8-E39F-4C47-8667-B976AE619654}.Debug|Win32.ActiveCfg = Debug|Win32
{336BCEC8-E39F-4C47-8667-B976AE619654}.Debug|Win32.Build.0 = Debug|Win32
{336BCEC8-E39F-4C47-8667-B976AE619654}.Release|Win32.ActiveCfg = Release|Win32
{336BCEC8-E39F-4C47-8667-B976AE619654}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Node-path: trunk/environmentvars.txt
Node-kind: file
Node-action: change
Text-content-length: 432
Text-content-md5: 570bc3c5dd2cad3f289831a2fba16904
Content-length: 432
Environment variables that need to be set:
------------------------------------------
VRS_HOME -> vrs-project includes&libs (www.vrs3d.org) [$(VRS_HOME)/include and $(VRS_HOME)/lib]
POSTGRESQL -> PostgreSQL database includes&libs (www.postgresql.org)
QTDIR -> qt3 includes&libs
XERCES_HOME -> Xerces XML-parser includes&libs (xml.apache.org/xerces-c)
FREETYPE_HOME -> Freetype 2.2.1 includes&libs (freetype.sourceforge.net)
Node-path: trunk/vrs_anno
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/vrs_anno/apps
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/vrs_anno/apps/smartmapllabels_01
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/vrs_anno/apps/smartmapllabels_01/main.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 11997
Text-content-md5: 5ed5e74438e17d7a9bc5d9c8b4e517a5
Content-length: 12007
PROPS-END
/******************************************************************************
* Copyright (C) 2000-2006 Computer Graphics Systems Group at the
* Hasso-Plattner-Institute (HPI), Potsdam, Germany.
*
* Project: vrs_annotation
* Author: stefan.maass@hpi.uni-potsdam.de
* Note: Don't use or distribute this code without permission. It will be
* officially released as a part of the VRS rendering system.
******************************************************************************/
#include
#ifdef WIN32
# define NOMINMAX
# include
# include // for random
#include
#define random rand
using namespace std;
#endif
// vrs includes
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifdef WIN32
// force linking with the importer/exporter VRSIO DLL
#include
namespace {
VRS::SO dummy = new VRS::JPEGReader;
}
#endif
#include
using namespace std;
using namespace VRS;
using namespace VRS::ANNOTATION;
using namespace VRS::TEXT;
// global variables
SO canvas_ = NULL;
SO keycb_ = NULL;
SO