Home / 1.4.0
Name Modified Size InfoDownloads / Week
Parent folder
cmdevenv-1.4.0-src.zip 2016-03-13 318.1 kB
cmdoc-1.4.0-src.zip 2016-03-13 142.4 kB
GettingStarted.pdf 2016-03-13 138.9 kB
LanguageSpec.pdf 2016-03-13 490.7 kB
readme.txt 2016-03-13 6.5 kB
vcredist_x64.exe 2016-03-13 14.8 MB
vcredist_x86.exe 2016-03-13 14.0 MB
cmajor-1.4.0-win-x86-setup.exe 2016-03-13 44.1 MB
cmajor-1.4.0-win-x64-setup.exe 2016-03-13 47.1 MB
cmajor-1.4.0-src.zip 2016-03-13 18.6 MB
cmajor-1.4.0.tar.gz 2016-03-13 17.8 MB
cmajor-1.4.0.tar.bz2 2016-03-13 15.3 MB
Totals: 12 Items   172.7 MB 0
====================
Cmajor version 1.4.0
====================

o   Unicode support. There are now three character types: char (8-bit unsigned), wchar (16-bit unsigned) and
    uchar (32-bit unsigned) for storing 8-bit, UTF-16 and UTF-32 character values respectively.
    There are implicit conversions from char to wchar to uchar, and explicit narrowing conversions from
    uchar to wchar to char. wchar and uchar are new keywords.

    System.String class is changed to a template taking character type as a template parameter.
    There are now three kinds of string values:
    -   string is a typedef for System.String<char>. It is used for representing ASCII and UTF-8 encoded strings.
    -   wstring is a typedef for System.String<wchar>. It is used for representing Unicode UTF-16 encoded strings.
    -   ustring is a typedef for System.String<uchar>. It is used for representing Unicode UTF-32 encoded strings.

    Cmajor source files are now by definition UTF-8 encoded so that string literals have UTF-8 encoding.
    In Windows when writing to stdout or stderr UTF-8 encoded strings are converted to UTF-16 for output.
    Similarly when a reading string from stdin in Windows, input is read in UTF-16 format and then converted to UTF-8.
    When writing to other files in Windows strings are output UTF-8 encoded.
    You can turn off UTF-16 conversion to stdout in Windows by passing an environment variable CM_UNICODE_STDOUT=0 to the program.
    You can turn off UTF-16 conversion to stderr in Windows by passing an environment variable CM_UNICODE_STDERR=0 to the program.
    You can turn off UTF-16 input conversion in Windows by passing an environment variable CM_UNICODE_STDIN=0 to the program.
    In Linux strings are always output UTF-8 encoded because UTF-8 locale can correctly handle them.

    There are now conversion functions for doing string conversion:
    -   string System.Unicode.ToUtf8(const wstring& s) that takes a UTF-16 encoded string and converts it to UTF-8 string.
    -   string System.Unicode.ToUtf8(const ustring& s) that takes a UTF-32 encoded string and converts it to UTF-8 string.
    -   wstring System.Unicode.ToUtf16(const string& s) that takes a UTF-8 encoded string and converts it to UTF-16 string.
    -   wstring System.Unicode.ToUtf16(const ustring& s) that takes a UTF-32 encoded string and converts it to UTF-16 string.
    -   ustring System.Unicode.ToUtf32(const string& s) that takes a UTF-8 encoded string and converts it to UTF-32 string.
    -   ustring System.Unicode.ToUtf32(const wstring& s) that takes a UTF-16 encoded string and converts it to UTF-32 string.

    System.Unicode namespace (see unicode.cm source file in system directory) contains character classification functions:
    -   Category GetCategory(uchar c) returns enumerated character classification value.
    -   string GetCategoryName(Category category) returns Unicode category name string for enumerated category value
        ("Lu", "Lc", etc.).
    -   string GetCharactername(uchar c) returns Unicode character name.
    -   uchar ToLower(uchar c) returns character converted to lower case.
    -   uchar ToUpper(uchar c) returns character converted to upper case.
    -   bool IsLetter(uchar c) return true if character has Unicode category Lu (upper case letter), Lt (lower case letter),
        LC (cased letter), Lm (modifier letter), Lo (other letter), or Lt (title letter).
    -   bool IsLower(uchar c) returns true if character is lower case letter (Lt).
    -   bool IsUpper(uchar c) returns true if character is upper case letter (Lu).
    -   bool IsMark(uchar c) returns true if character has Unicode category Mc (mark spacing), Me (mark enclosing) or
        Mn (mark nonspacing).
    -   bool IsNumber(uchar c) returns true if character has Unicode category Nd (decimal number), Nl (letter number) or
        No (other number).
    -   bool IsPunctuation(uchar c) returns true if character has Unicode category Pc, Pd, Pe, Pf, Pi, Po or Ps.
    -   bool IsSymbol(uchar c) returns true if character has Unicode category Sc (currency symbol), Sk (modifier symbol),
        Sm (math symbol) or So (other symbol).
    -   bool IsSeparator(uchar c) returns true if character has Unicode category Zl (line separator), Zp (paragraph separator)
        or Zs (space separator).

    ToUpper and ToLower functions are now overloaded for all three string types:
    -   string ToUpper(const string& s) and string ToLower(const string& s);
    -   wstring ToUpper(const wstring& s) and wstring ToLower(const wstring& s);
    -   ustring ToUpper(const ustring& s) and ustring ToLower(const ustring& s);

o   Interfaces. A class can have at most one base class but can implement any number of interfaces.
    interface is a new keyword.

    For example:

    public interface Reader
    {
        string Read();
    }
    public interface Writer
    {
        void Write(const string& s);
    }
    public class ConsoleIo : Reader, Writer
    {
        public string Read()
        {
            return Console.ReadLine();
        }
        public void Write(const string& s)
        {
            Console.WriteLine(s);
        }
    }
    public void Up(Reader reader, Writer writer)
    {
        string line = reader.Read();
        writer.Write(ToUpper(line));
    }
    public void Test()
    {
        ConsoleIo console;
        Up(Reader(&console), Writer(&console));
    }

---------------------------------------------
Files:
---------------------------------------------

o   cmajor-1.4.0-win-x64-setup.exe
    64-bit Windows setup.

o   cmajor-1.4.0-win-x86-setup.exe
    32-bit Windows setup.

o   cmajor-1.4.0-src.zip
    Source code for compiler and command line tools.

o   cmdevenv-1.4.0-src.zip
    Source code for Cmajor Development Environment and
    Cmajor Profile Report Viewer (both written in C#).

o   cmdoc-1.4.0-src.zip
    Source code for Cmajor Library Documenter

o   cmajor-1.4.0.tar.gz
    Linux source distribution in gzipped tar format.

o   cmajor-1.4.0.tar.bz2
    Linux source distribution in bzip2 tar format.

o   GettingStarted.pdf
    Installation instructions and troubleshooting.

o   readme.txt
    This readme.

o   vcredist_x64.exe
    Visual C++ Redistributable for Visual Studio 2015 (64-bit).

o   vcredist_x86.exe
    Visual C++ Redistributable for Visual Studio 2015 (32-bit).
Source: readme.txt, updated 2016-03-13