No description
Find a file
Jeff Epler 84472921c1 Don't open part 21 files as text files
On Windows, when a file is opened in "text" mode, but it actually
contains Unix-style line endings, the behavior of tellg() is
unexpected.

Consider this program which puts the (binary) contents "a\nb\n" in a
file, then opens it in text mode for reading.  It prints each
character read, along with the value returned by tellg():

    #include <iostream>
    #include <fstream>

    int main()
    {
        {
            std::ofstream f("myfile.txt", std::ios::binary);
            f << "a\nb\n";
        }

        std::ifstream f("myfile.txt");

        for (char c=0; f.get(c);)
            std::cout << f.tellg() << ' ' << int(c) << '\n';
    }

On a UNIX platform which does not have a distinction between "text"
and "binary" files, the output will read
    1 97
    2 10
    3 98
    4 10
because the file position simply advances one position after each
byte is read.

On Windows with the Visual Studio C and C++ runtime, the result is
instead
    -1 97
    1 10
    2 98
    4 10
While it is impossible to say exactly what the Windows runtime is
doing here, it appears that it is trying to adjust for the mismatch
between "number of bytes read in byte oriented mode and "number of
bytes read in text mode".

Since "part21" files don't necessarily contain CRLF line endings
when viewed in binary mode, open the file in binary mode.  This
fixes the test failure seen on appveyor ci running the
"test_inverse_attr3" test.
2017-08-21 17:11:50 -05:00
cmake Add an option to completely bypass the git management of the version header. 2016-08-06 13:53:12 -04:00
data Revert "Get latest version of ap242 from http://stepmod.cvs.sourceforge.net/viewvc/stepmod/stepmod/data/modules/ap242_managed_model_based_3d_engineering/mim_lf.exp" 2016-08-06 16:51:58 -04:00
doc update Doxyfile 2015-05-20 20:03:53 -04:00
example/ap203min Add ExternalProject_add based build of ap203min example 2015-03-27 08:38:38 -07:00
include test for, and use, nullptr if we have it 2015-08-03 21:37:28 -04:00
misc appveyor log - use JSON-like console data, massaged for parsability 2015-08-23 22:30:16 -04:00
src Don't open part 21 files as text files 2017-08-21 17:11:50 -05:00
test test for, and use, nullptr if we have it 2015-08-03 21:37:28 -04:00
.appveyor.yml appveyor: exclude hanging test 2015-08-10 21:06:51 -04:00
.gitignore update .gitignore 2015-02-08 17:51:05 -05:00
.travis.yml update CI-related stuff 2015-07-19 15:02:54 -04:00
AUTHORS bump version (0.8), update AUTHORS, NEWS for v0.8, add travis-ci build status to README 2014-12-26 15:10:00 -05:00
ChangeLog v0.7: Update changelog, INSTALL, NEWS, README, version string 2013-04-15 20:07:01 -04:00
CMakeLists.txt Add an option to completely bypass the git management of the version header. 2016-08-06 13:53:12 -04:00
CONTRIBUTING.md add CONTRIBUTING.md 2015-07-19 15:02:54 -04:00
COPYING Update text files for v0.6 2012-05-25 22:12:37 -04:00
ctest_matrix.cmake Case and whitespace on toplevel CMake files 2014-03-01 11:53:30 -05:00
CTestConfig.cmake Add CMake footer comment to CMake files 2014-02-28 22:06:09 -05:00
INSTALL v0.7: Update changelog, INSTALL, NEWS, README, version string 2013-04-15 20:07:01 -04:00
lcov.cmake Case and whitespace on toplevel CMake files 2014-03-01 11:53:30 -05:00
NEWS NEWS: forgot to include BRL-CAD changes 2014-12-26 16:55:44 -05:00
README.md README: put CI badges in table 2015-08-23 22:30:36 -04:00
run_ctest.cmake Case and whitespace on toplevel CMake files 2014-03-01 11:53:30 -05:00
SC_VERSION.txt bump version (0.8), update AUTHORS, NEWS for v0.8, add travis-ci build status to README 2014-12-26 15:10:00 -05:00

Travis-CI AppVeyor CI
Linux, OSX (LLVM) Windows (MSVC)
Build Status Build status

STEPcode v0.8 -- stepcode.org, github.com/stepcode/stepcode

  • What is STEPcode? SC reads ISO10303-11 EXPRESS schemas and generates C++ source code that can read and write Part 21 files conforming to that schema. In addition to C++, SC includes experimental support for Python.

  • Renamed in April/May 2012: SC was formerly known as STEP Class Libraries, SCL for short. It was renamed because the name wasn't accurate: the class libraries make up only a part of the code.

  • Much of the work to update SC has been done by the developers of BRL-CAD, and SC (then STEP Class Library) was originally created at NIST in the 90's.

  • For information on changes version-by-version, see the NEWS file

  • Building and testing SCL - see the INSTALL file

  • For more details on the libraries and executables, see the wiki: http://github.com/stepcode/stepcode/wiki/About-STEPcode

  • For license details, see the COPYING file. Summary: 3-clause BSD.



CODING STANDARDS

SC's source has been reformatted with astyle. When making changes, try to match the current formatting. The main points are:

  • compact (java-style) brackets:
    if( a == 3 ) {
        c = 5;
        function( a, b );
    } else {
        somefunc( );
    }
  • indents are 4 spaces
  • no tab characters
  • line endings are LF (linux), not CRLF (windows)
  • brackets around single-line conditionals
  • spaces inside parentheses and around operators
  • return type on the same line as the function name, unless that's too long
  • doxygen-style comments (see http://www.stack.nl/~dimitri/doxygen/docblocks.html)

If in doubt about a large patch, run astyle with the config file misc/astyle.cfg. Download astyle from http://sourceforge.net/projects/astyle/files/astyle/


For more info, see the wiki.