// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "fileconf.h"
#endif
#pragma hdrstop
#endif //__BORLANDC__
-#if wxUSE_CONFIG
+#if wxUSE_CONFIG && wxUSE_FILECONFIG
#ifndef WX_PRECOMP
#include "wx/string.h"
// "template" array types
// ----------------------------------------------------------------------------
-WX_DEFINE_SORTED_EXPORTED_ARRAY(wxFileConfigEntry *, ArrayEntries);
-WX_DEFINE_SORTED_EXPORTED_ARRAY(wxFileConfigGroup *, ArrayGroups);
+#ifdef WXMAKINGDLL_BASE
+ WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(wxFileConfigEntry *, ArrayEntries,
+ WXDLLIMPEXP_BASE);
+ WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(wxFileConfigGroup *, ArrayGroups,
+ WXDLLIMPEXP_BASE);
+#else
+ WX_DEFINE_SORTED_ARRAY(wxFileConfigEntry *, ArrayEntries);
+ WX_DEFINE_SORTED_ARRAY(wxFileConfigGroup *, ArrayGroups);
+#endif
// ----------------------------------------------------------------------------
// wxFileConfigLineList
SetPath(strGroup);
if ( bLocal )
+ {
+ if ( m_pCurrentGroup->Parent() )
+ m_pCurrentGroup->Parent()->SetLastGroup(m_pCurrentGroup);
m_pCurrentGroup->SetLine(m_linesTail);
+ }
// check that there is nothing except comments left on this line
bool bCont = TRUE;
if ( pEntry == NULL ) {
// new entry
pEntry = m_pCurrentGroup->AddEntry(strKey, n);
-
- // <JACS>
- // Take the opportunity to set some pointers now
- // that we know there are items in this group.
- // Otherwise, items added to a newly read file
- // can be put in the wrong place.
- m_pCurrentGroup->SetLastEntry(pEntry);
- if (m_pCurrentGroup->Parent())
- m_pCurrentGroup->Parent()->SetLastGroup(m_pCurrentGroup);
- // </JACS>
-
- if ( bLocal )
- pEntry->SetLine(m_linesTail);
}
else {
if ( bLocal && pEntry->IsImmutable() ) {
wxLogWarning(_("file '%s', line %d: key '%s' was first found at line %d."),
buffer.GetName(), n + 1, strKey.c_str(), pEntry->Line());
- if ( bLocal )
- pEntry->SetLine(m_linesTail);
}
}
+ if ( bLocal )
+ pEntry->SetLine(m_linesTail);
+
// skip whitespace
while ( wxIsspace(*pEnd) )
pEnd++;
else // this entry didn't exist in the local file
{
// add a new line to the file
- wxASSERT( m_nLine == wxNOT_FOUND ); // consistency check
-
wxFileConfigLineList *line = Group()->GetLastEntryLine();
m_pLine = Group()->Config()->LineListInsert(strLine, line);