From: Mikko Rasa Date: Mon, 11 Aug 2008 17:05:51 +0000 (+0000) Subject: Improve and update Readme.txt X-Git-Tag: 1.0 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ca124b5ae96ce178d5a5f32777c03e1ae3306ba8;p=libs%2Fdatafile.git Improve and update Readme.txt Add Readme.txt and License.txt to tarball Bump version number for release Update svn:ignore Remove outdated Makefile --- diff --git a/Build b/Build index 9012c60..99edb31 100644 --- a/Build +++ b/Build @@ -2,8 +2,11 @@ package "mspdatafile" { - version "0.2"; - description "Mikkosoft Productions datafile library"; + version "1.0"; + description "Structured datafile library"; + + tar_file "Readme.txt"; + tar_file "License.txt"; require "mspcore"; require "mspstrings"; diff --git a/Makefile b/Makefile deleted file mode 100644 index 99bf5e2..0000000 --- a/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -NAME = parser - -WORKDIR = $(PWD)/../.. -TMP = $(WORKDIR)/tmp/linux -TGT = $(HOME)/local - -CXX = g++ -CC = gcc -AR = ar -CP = cp - -LIBFILE = libmsp$(NAME) - -MAKEFLAGS += -s --no-print-directory -INCLUDE = -Isource -I$(TMP)/include -LIB = -L$(TMP) -DEBUG = -CFLAGS = $(DEBUG) $(INCLUDE) -pipe -Wall -CXXFLAGS = $(CFLAGS) - -PIC = -fPIC -SHARED = .so -STATIC = .a - -SRC = source -OBJS = $(addprefix $(TMP)/, $(addsuffix .o, $(notdir $(basename $(wildcard $(SRC)/*.cpp))))) - -pkgincludedir = include/msp/$(NAME) -libdir = lib - -.PHONY: all -all: $(TMP) $(TMP)/$(LIBFILE)$(SHARED) $(TMP)/$(LIBFILE)$(STATIC) tmpheaders - -# Create temp directory -$(TMP): - mkdir -p $@ - -# Dynamic library -$(TMP)/$(LIBFILE)$(SHARED): $(OBJS) - echo "Compiling $(notdir $@)" - $(CXX) $^ -shared -o $@ $(LIB) $(LDFLAGS) - -# Static library -$(TMP)/$(LIBFILE)$(STATIC): $(OBJS) - echo "Compiling $(notdir $@)" - $(AR) rcs $@ $^ - -# Copy headers to temp -.PHONY: tmpheaders -tmpheaders: $(TMP)/$(pkgincludedir) - $(CP) $(SRC)/*.h $< - -$(TMP)/$(pkgincludedir): - mkdir -p $@ - -# Library object file -$(TMP)/%.o: $(SRC)/%.cpp $(wildcard $(SRC)/*.h) - echo "Compiling $(NAME)/$(notdir $(basename $@))" - $(CXX) $(PIC) $(CXXFLAGS) -c $< -o $@ - -# Installs -.PHONY: install -install: install_lib - -$(TGT)/$(pkgincludedir): - mkdir -p $@ - -$(TGT)/$(libdir): - mkdir -p $@ - -.PHONY: install_headers -install_headers: $(TGT)/$(pkgincludedir) - echo "Installing $(NAME) headers to $<" - $(CP) $(SRC)/*.h $< - -.PHONY: install_lib -install_lib: $(TGT)/$(libdir) $(TMP)/$(LIBFILE)$(SHARED) - echo "Installing dynamic library to $<" - $(CP) $(TMP)/$(LIBFILE)$(SHARED) $< - -.PHONY: install_staticlib -install_staticlib: $(TGT)/$(libdir) $(TMP)/$(LIBFILE)$(STATIC) - echo "Installing static library to $<" - $(CP) $(TMP)/$(LIBFILE)$(STATIC) $< diff --git a/Readme.txt b/Readme.txt index 2c03cf2..b507110 100644 --- a/Readme.txt +++ b/Readme.txt @@ -1,21 +1,19 @@ libmspdatafile - structured datafile library -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions -Version 0.1 readme +Version 1.0 readme +1. Description + Libmspdatafile is a library for reading and writing structured data files. It supports both a human-readable text format and a more compact binary format. The text-based format is designed to be compact yet clean, avoiding much of the redundancy of XML. -Libmspdatafile is distributed under the terms of the GNU Lesser Public License. -Full text of the license can be found in the file License.txt. - -*** Structure +2. Technical overview The basic building block of a datafile is a statement. A statement has a -keyword and zero or more arguments. It may also have zero or more substate- +keyword and zero or more arguments. It may also have any number of substate- ments. The interface is heavily object-oriented and typically one statement in a file @@ -23,7 +21,7 @@ represents one object in the program's memory. The library supports five basic data types: integers, floats, strings, booleans and enums. Data types are strictly enforced - the only allowed conversion is -from float to integer. +from integer to float. The correct argument types for a statement is determined from the function or variable used to load it. This means that semantical validation can only be @@ -31,7 +29,7 @@ done by the program that actually uses the file. A generic tool can only perform syntactic validation. -*** Basic usage +3. Basic usage Loading data from files is achieved through Loader classes. Such a class must be derived from the DataFile::Loader class. In the constructor, a series of @@ -47,12 +45,12 @@ It is also possible to call the Parser::parse function directly and obtain a raw Statement. However, this is rarely useful. -*** Syntax +4. Datafile syntax The syntax of the text format vaguely resembles C. Statements are terminated with a semicolon and substatements are enclosed between burly braces. The sub- statement block comes after all arguments and the semicolon comes after it. An -empty substatement block is allowed and equal to an absent block. +empty substatement block is allowed and equal to an absent one. Integers can be written in decimal, octal or hexadecimal notation. A minus sign can be used in any base for negative numbers, as well as an optional plus @@ -72,7 +70,7 @@ alphaumeric characters and underscores and must begin with a letter or an underscore. -*** Binary format +5. Binary format The binary format is not intended to be manipulated by anything else than libmspdatafile. A detailed description is not available at this time. @@ -81,4 +79,25 @@ The tool provided with the library can be used to convert between the two formats. -*** $Id$ +6. License + +Copyright © 2006-2008 Mikko Rasa, Mikkosoft Productions + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Full license text can be found in License.txt. + + +($Id$)