Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
efceacbd
Commit
efceacbd
authored
Dec 20, 2010
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Plain Diff
more DIR_LIB_SOURCE work
parents
c4a6b418
8384d7e0
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
292 additions
and
74 deletions
+292
-74
CMakeLists.txt
CMakeLists.txt
+1
-0
CMakeLists.txt
new/CMakeLists.txt
+3
-2
design.h
new/design.h
+0
-15
sch_dir_lib_source.cpp
new/sch_dir_lib_source.cpp
+221
-32
sch_dir_lib_source.h
new/sch_dir_lib_source.h
+26
-19
sch_lib.h
new/sch_lib.h
+6
-6
toolchain-mingw.cmake
new/toolchain-mingw.cmake
+35
-0
No files found.
CMakeLists.txt
View file @
efceacbd
...
...
@@ -212,6 +212,7 @@ add_subdirectory(polygon)
add_subdirectory
(
polygon/kbool/src
)
add_subdirectory
(
potrace
)
add_subdirectory
(
bitmap2component
)
#add_subdirectory(new)
#############
# Resources #
...
...
new/CMakeLists.txt
View file @
efceacbd
...
...
@@ -56,10 +56,11 @@ else(DOXYGEN_FOUND)
endif
()
include_directories
(
${
CMAKE_SOURCE_DIR
}
)
include_directories
(
${
CMAKE_
CURRENT_
SOURCE_DIR
}
)
add_executable
(
test_dir_lib_source sch_dir_lib_source.cpp
)
add_executable
(
test_dir_lib_source sch_dir_lib_source.cpp
${
PROJECT_SOURCE_DIR
}
/common/richio.cpp
)
#add_executable( test_dir_lib_source EXCLUDE_FROM_ALL sch_dir_lib_source.cpp )
target_link_libraries
(
test_dir_lib_source
${
wxWidgets_LIBRARIES
}
)
#target_link_libraries( test_dir_lib_source common ${wxWidgets_LIBRARIES} )
new/design.h
View file @
efceacbd
...
...
@@ -352,21 +352,6 @@ Show architecture here.
*/
typedef
std
::
string
STRING
;
/**
* Type STRING_TOKS
* documents a container which holds a sequence of s-expressions suitable for parsing
* with DSNLEXER. This can either be a sequence of DSN_SYMBOLs or a sequence of
* fully parenthesis delimited s-expressions. There are 2 types: <ol>
* <li> R C R33 "quoted-name" J2
* <li> (part R ())(part C ())
* </ol>
* Notice that in the 1st example, there are 5 tokens in sequence, and in the
* 2nd example there are two top most s-expressions in sequence. So the counts
* in these are 5 and 2 respectively.
*/
typedef
std
::
dequeue
<
STRING
>
STRING_TOKS
;
typedef
std
::
dequeue
<
STRING
>
STRINGS
;
//typedef std::vector<wxString> WSTRINGS;
...
...
new/sch_dir_lib_source.cpp
View file @
efceacbd
This diff is collapsed.
Click to expand it.
new/sch_dir_lib_source.h
View file @
efceacbd
...
...
@@ -29,6 +29,7 @@
#include <sch_lib.h>
#include <map>
#include <vector>
/**
...
...
@@ -52,10 +53,13 @@ class DIR_LIB_SOURCE : public LIB_SOURCE
{
friend
class
LIBS
;
///< LIBS::GetLib() can construct one.
bool
useVersioning
;
///< use files with extension ".revNNN..", else not
bool
useVersioning
;
///< use files with extension ".revNNN..", else not
DIR_CACHE
sweets
;
///< @todo, don't really need to cache the sweets, only the partnames.
STRINGS
categories
;
std
::
vector
<
char
>
readBuffer
;
///< used by readSExpression()
DIR_CACHE
sweets
;
STRINGS
categories
;
/**
* Function isPartFileName
...
...
@@ -75,6 +79,13 @@ class DIR_LIB_SOURCE : public LIB_SOURCE
bool
makePartFileName
(
const
char
*
aEntry
,
const
STRING
&
aCategory
,
STRING
*
aPartName
);
/**
* Function readSExpression
* reads an s-expression into aResult. Candidate for virtual function later.
*/
void
readSExpression
(
STRING
*
aResult
,
const
STRING
&
aNameSpec
)
throw
(
IO_ERROR
);
/**
* Function doOneDir
* loads part names [and categories] from a directory given by
...
...
@@ -109,39 +120,35 @@ public:
//-----<LIB_SOURCE implementation functions >------------------------------
void
ReadPart
(
STRING
*
aResult
,
const
STRING
&
aPartName
,
const
STRING
&
aRev
=
StrEmpty
)
throw
(
IO_ERROR
)
{
}
throw
(
IO_ERROR
);
void
ReadParts
(
STRING_TOKS
*
aResults
,
const
STRINGS
&
aPartNames
)
throw
(
IO_ERROR
)
{
}
void
ReadParts
(
STRINGS
*
aResults
,
const
STRINGS
&
aPartNames
)
throw
(
IO_ERROR
);
void
GetCategories
(
STRING_TOKS
*
aResults
)
throw
(
IO_ERROR
)
{
}
void
GetCategories
(
STRINGS
*
aResults
)
throw
(
IO_ERROR
);
void
GetCategoricalPartNames
(
STRING_TOKS
*
aResults
,
const
STRING
&
aCategory
=
StrEmpty
)
throw
(
IO_ERROR
)
{
}
void
GetCategoricalPartNames
(
STRINGS
*
aResults
,
const
STRING
&
aCategory
=
StrEmpty
)
throw
(
IO_ERROR
);
void
GetRevisions
(
STRING
_TOK
S
*
aResults
,
const
STRING
&
aPartName
)
throw
(
IO_ERROR
)
void
GetRevisions
(
STRINGS
*
aResults
,
const
STRING
&
aPartName
)
throw
(
IO_ERROR
)
{
// @todo
}
void
FindParts
(
STRING
_TOK
S
*
aResults
,
const
STRING
&
aQuery
)
throw
(
IO_ERROR
)
void
FindParts
(
STRINGS
*
aResults
,
const
STRING
&
aQuery
)
throw
(
IO_ERROR
)
{
// @todo
}
//-----</LIB_SOURCE implementation functions >------------------------------
#if defined(DEBUG)
/**
* Function Show
* will output a debug dump of contents.
*/
void
Show
();
#endif
};
}
// namespace SCH
...
...
new/sch_lib.h
View file @
efceacbd
...
...
@@ -40,7 +40,7 @@
typedef
std
::
string
STRING
;
typedef
std
::
deque
<
STRING
>
STRINGS
;
typedef
STRINGS
STRING
_TOK
S
;
typedef
STRINGS
STRINGS
;
extern
const
STRING
StrEmpty
;
...
...
@@ -93,14 +93,14 @@ protected: ///< derived classes must implement
* @param aPartNames is a list of part names, one name per list element.
* @param aResults receives the s-expressions
*/
virtual
void
ReadParts
(
STRING
_TOK
S
*
aResults
,
const
STRINGS
&
aPartNames
)
virtual
void
ReadParts
(
STRINGS
*
aResults
,
const
STRINGS
&
aPartNames
)
throw
(
IO_ERROR
)
=
0
;
/**
* Function GetCategories
* fetches all categories present in the library source into @a aResults
*/
virtual
void
GetCategories
(
STRING
_TOK
S
*
aResults
)
virtual
void
GetCategories
(
STRINGS
*
aResults
)
throw
(
IO_ERROR
)
=
0
;
/**
...
...
@@ -112,7 +112,7 @@ protected: ///< derived classes must implement
*
* @param aResults is a place to put the fetched result, one category per STRING.
*/
virtual
void
GetCategoricalPartNames
(
STRING
_TOK
S
*
aResults
,
const
STRING
&
aCategory
=
StrEmpty
)
virtual
void
GetCategoricalPartNames
(
STRINGS
*
aResults
,
const
STRING
&
aCategory
=
StrEmpty
)
throw
(
IO_ERROR
)
=
0
;
/**
...
...
@@ -120,7 +120,7 @@ protected: ///< derived classes must implement
* fetches all revisions for @a aPartName into @a aResults. Revisions are strings
* like "rev12", "rev279", and are library source agnostic. These
*/
virtual
void
GetRevisions
(
STRING
_TOK
S
*
aResults
,
const
STRING
&
aPartName
)
virtual
void
GetRevisions
(
STRINGS
*
aResults
,
const
STRING
&
aPartName
)
throw
(
IO_ERROR
)
=
0
;
/**
...
...
@@ -139,7 +139,7 @@ protected: ///< derived classes must implement
*
* @param aResults is a place to put the fetched part names, one part per STRING.
*/
virtual
void
FindParts
(
STRING
_TOK
S
*
aResults
,
const
STRING
&
aQuery
)
virtual
void
FindParts
(
STRINGS
*
aResults
,
const
STRING
&
aQuery
)
throw
(
IO_ERROR
)
=
0
;
//-----</abstract for implementors>--------------------------------------
...
...
new/toolchain-mingw.cmake
0 → 100644
View file @
efceacbd
# This is a CMake toolchain file for ARM:
# http://vtk.org/Wiki/CMake_Cross_Compiling
# usage
# cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchain-mingw.cmake ..
# It is here to assist Dick with verifying compilation of /new stuff with mingw (under linux)
set
(
CMAKE_SYSTEM_NAME Linux
)
# Specific to Dick's machine, again for testing only:
include_directories
(
/svn/wxWidgets/include
)
#-----<configuration>-----------------------------------------------
# configure only the lines within this <configure> block, typically
# specify the cross compiler
set
(
CMAKE_C_COMPILER i586-mingw32msvc-gcc
)
set
(
CMAKE_CXX_COMPILER i586-mingw32msvc-g++
)
# where is the target environment
set
(
CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc
)
#-----</configuration>-----------------------------------------------
# search for programs in the build host directories
set
(
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER
)
# for libraries and headers in the target directories
set
(
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY
)
set
(
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment