Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nk@3134 9da81c78-c036-0410-9e1f-a2b0375e4b5a
  • Loading branch information
eranif committed Oct 8, 2009
1 parent 3b77a67 commit c09c174
Show file tree
Hide file tree
Showing 95 changed files with 8,365 additions and 5,702 deletions.
15 changes: 13 additions & 2 deletions CodeLite/CodeLite.project
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
<![CDATA[00040001N0012DebugUnicode0000000000000001N0014ReleaseUnicode0000000000000001N0015WinDebugUnicode0000000000000001N0017WinReleaseUnicode000000000000
]]>
</Plugin>
</Plugins>
Expand All @@ -30,12 +40,10 @@
<File Name="tags_options_data.cpp"/>
<File Name="setters_getters_data.cpp"/>
<File Name="archive.cpp"/>
<File Name="winprocess.h"/>
<File Name="winprocess.cpp"/>
<File Name="cl_calltip.cpp"/>
<File Name="performance.cpp"/>
<File Name="fileextmanager.cpp"/>
<File Name="fileextmanager.h"/>
</VirtualDirectory>
<VirtualDirectory Name="Header Files">
<File Name="y.tab.h"/>
Expand Down Expand Up @@ -71,6 +79,8 @@
<File Name="extdbdata.h"/>
<File Name="cl_calltip.h"/>
<File Name="performance.h"/>
<File Name="fileextmanager.h"/>
<File Name="winprocess.h"/>
</VirtualDirectory>
<VirtualDirectory Name="GeneratedFiles">
<File Name="expression_result.h"/>
Expand All @@ -96,6 +106,7 @@
<File Name="variable_entry.h"/>
<File Name="fileentry.cpp"/>
<File Name="fileentry.h"/>
<File Name="istorage.h"/>
</VirtualDirectory>
<Dependencies/>
<Dependencies/>
Expand Down
10 changes: 7 additions & 3 deletions CodeLite/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,9 @@ bool Archive::Read(const wxString &name, int &value)

long v;
bool res = ReadSimple(v, wxT("int"), name);
value = v;
if ( res ) {
value = v;
}
return res;
}

Expand All @@ -419,7 +421,9 @@ bool Archive::Read(const wxString &name, bool &value)
{
long v;
bool res = ReadSimple(v, wxT("bool"), name);
v == 0 ? value = false : value = true;
if( res ) {
v == 0 ? value = false : value = true;
}
return res;
}

Expand Down Expand Up @@ -471,7 +475,7 @@ bool Archive::Read(const wxString &name, wxString &value)
}
wxXmlNode *node = FindNodeByName(m_root, wxT("wxString"), name);
if (node) {
value = node->GetPropVal(wxT("Value"), wxEmptyString);
value = node->GetPropVal(wxT("Value"), value);
return true;
}
return false;
Expand Down
157 changes: 36 additions & 121 deletions CodeLite/comment.cpp
Original file line number Diff line number Diff line change
@@ -1,136 +1,51 @@
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright : (C) 2008 by Eran Ifrah
// file name : comment.cpp
//
// copyright : (C) 2008 by Eran Ifrah
// file name : comment.cpp
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#include "precompiled_header.h"

#include "comment.h"
#include <iostream>

#ifdef __VISUALC__
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#endif
#include "precompiled_header.h"
#include "comment.h"
#include <iostream>


Comment::Comment(wxSQLite3ResultSet & rs)
Comment::Comment(const Comment& rhs)
{
m_comment = rs.GetString(0);
m_file = rs.GetString(1);
m_line = rs.GetInt(2);
}

Comment::Comment(const Comment& rhs)
{
*this = rhs;
}

Comment::Comment(const wxString & comment, const wxString & file, const int line)
: m_comment( comment )
, m_file( file )
, m_line( line )
{
m_comment.erase(m_comment.find_last_not_of(_T("\n\r\t"))+1);
}
*this = rhs;
}

Comment::Comment(const wxString & comment, const wxString & file, const int line)
: m_comment( comment )
, m_file( file )
, m_line( line )
{
m_comment.erase(m_comment.find_last_not_of(_T("\n\r\t"))+1);
}

Comment & Comment::operator=(const Comment &rhs)
{
if( this == &rhs )
if ( this == &rhs )
return *this;

m_comment = rhs.m_comment;
m_file = rhs.m_file;
m_line = rhs.m_line;
return *this;
}

int Comment::Store(wxSQLite3Statement& insertPreparedStmnt, TagsDatabase* db)
{
try
{
insertPreparedStmnt.Bind(1, GetComment());
insertPreparedStmnt.Bind(2, GetFile());
insertPreparedStmnt.Bind(3, GetLine());
insertPreparedStmnt.ExecuteUpdate();
insertPreparedStmnt.Reset();
}
catch(wxSQLite3Exception& exc)
{
if(exc.ErrorCodeAsString(exc.GetErrorCode()) == _T("SQLITE_CONSTRAINT"))
return TagExist;
std::cerr << "Error: " << exc.GetMessage() << std::endl;
return TagError;
}
return TagOk;
}

int Comment::Update(wxSQLite3Statement& updatePreparedStmnt)
{
try
{
updatePreparedStmnt.Bind(1, GetComment());
updatePreparedStmnt.Bind(2, GetFile());
updatePreparedStmnt.Bind(3, GetLine());
updatePreparedStmnt.ExecuteUpdate();
updatePreparedStmnt.Reset();
}
catch(wxSQLite3Exception& exc)
{
std::cerr << "Error: " << exc.GetMessage() << std::endl;
return TagError;
}
return TagOk;
}

int Comment::Delete(wxSQLite3Statement& deletePreparedStmnt)
{
try
{
deletePreparedStmnt.Bind(1, GetFile());
deletePreparedStmnt.Bind(2, GetLine());
deletePreparedStmnt.ExecuteUpdate();
deletePreparedStmnt.Reset();
}
catch(wxSQLite3Exception& exc)
{
std::cerr << "Error: " << exc.GetMessage() << std::endl;
return TagError;
}
return TagOk;
}

wxString Comment::GetDeleteOneStatement()
{
return _T("DELETE FROM COMMENTS WHERE File=? AND Line=?");
}

wxString Comment::GetUpdateOneStatement()
{
return _T("UPDATE COMMENTS SET Comment=? WHERE File=? AND Line=?");
}

wxString Comment::GetInsertOneStatement()
{
return _T("INSERT INTO COMMENTS VALUES (?, ?, ?)");
m_file = rhs.m_file;
m_line = rhs.m_line;
return *this;
}
Loading

0 comments on commit c09c174

Please sign in to comment.