Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50249 - in trunk/tools/release: . release-mgt-msvc release-mgt-msvc/strftime
From: bdawes_at_[hidden]
Date: 2008-12-12 13:20:46


Author: bemandawes
Date: 2008-12-12 13:20:45 EST (Fri, 12 Dec 2008)
New Revision: 50249
URL: http://svn.boost.org/trac/boost/changeset/50249

Log:
Add strftime
Added:
   trunk/tools/release/release-mgt-msvc/ (props changed)
      - copied from r50228, /trunk/tools/release/msvc/
   trunk/tools/release/release-mgt-msvc/strftime/
   trunk/tools/release/release-mgt-msvc/strftime/strftime.vcproj (contents, props changed)
   trunk/tools/release/strftime.cpp (contents, props changed)
Text files modified:
   trunk/tools/release/release-mgt-msvc/msvc.sln | 6 ++++++
   1 files changed, 6 insertions(+), 0 deletions(-)

Modified: trunk/tools/release/release-mgt-msvc/msvc.sln
==============================================================================
--- /trunk/tools/release/msvc/msvc.sln (original)
+++ trunk/tools/release/release-mgt-msvc/msvc.sln 2008-12-12 13:20:45 EST (Fri, 12 Dec 2008)
@@ -3,6 +3,8 @@
 # Visual C++ Express 2008
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compare_trees", "compare_trees\compare_trees.vcproj", "{7E6AD5ED-4168-4613-A342-0217AA82DEC1}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strftime", "strftime\strftime.vcproj", "{4A82F955-7630-4B79-9C50-E45F27E28BA8}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -13,6 +15,10 @@
                 {7E6AD5ED-4168-4613-A342-0217AA82DEC1}.Debug|Win32.Build.0 = Debug|Win32
                 {7E6AD5ED-4168-4613-A342-0217AA82DEC1}.Release|Win32.ActiveCfg = Release|Win32
                 {7E6AD5ED-4168-4613-A342-0217AA82DEC1}.Release|Win32.Build.0 = Release|Win32
+ {4A82F955-7630-4B79-9C50-E45F27E28BA8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4A82F955-7630-4B79-9C50-E45F27E28BA8}.Debug|Win32.Build.0 = Debug|Win32
+ {4A82F955-7630-4B79-9C50-E45F27E28BA8}.Release|Win32.ActiveCfg = Release|Win32
+ {4A82F955-7630-4B79-9C50-E45F27E28BA8}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Added: trunk/tools/release/release-mgt-msvc/strftime/strftime.vcproj
==============================================================================
--- (empty file)
+++ trunk/tools/release/release-mgt-msvc/strftime/strftime.vcproj 2008-12-12 13:20:45 EST (Fri, 12 Dec 2008)
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="strftime"
+ ProjectGUID="{4A82F955-7630-4B79-9C50-E45F27E28BA8}"
+ RootNamespace="strftime"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\strftime.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/tools/release/strftime.cpp
==============================================================================
--- (empty file)
+++ trunk/tools/release/strftime.cpp 2008-12-12 13:20:45 EST (Fri, 12 Dec 2008)
@@ -0,0 +1,66 @@
+// Command line utility to output the date under control of a format string
+
+// Copyright 2008 Beman Dawes
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#define _CRT_SECURE_NO_WARNINGS
+
+#include <ctime>
+#include <string>
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
+
+int main(int argc, char * argv[])
+{
+ if (argc != 2 )
+ {
+ cerr <<
+ "Invoke: strftime format\n"
+ "Example: strftime \"The date is %Y?%m?%d in ISO format\""
+ "The format codes are:\n"
+ " %a Abbreviated weekday name\n"
+ " %A Full weekday name\n"
+ " %b Abbreviated month name\n"
+ " %B Full month name\n"
+ " %c Date and time representation appropriate for locale\n"
+ " %d Day of month as decimal number (01 – 31)\n"
+ " %H Hour in 24-hour format (00 – 23)\n"
+ " %I Hour in 12-hour format (01 – 12)\n"
+ " %j Day of year as decimal number (001 – 366)\n"
+ " %m Month as decimal number (01 – 12)\n"
+ " %M Minute as decimal number (00 – 59)\n"
+ " %p Current locale's A.M./P.M. indicator for 12-hour clock\n"
+ " %S Second as decimal number (00 – 59)\n"
+ " %U Week of year as decimal number, with Sunday as first day of week (00 – 53)\n"
+ " %w Weekday as decimal number (0 – 6; Sunday is 0)\n"
+ " %W Week of year as decimal number, with Monday as first day of week (00 – 53)\n"
+ " %x Date representation for current locale\n"
+ " %X Time representation for current locale\n"
+ " %y Year without century, as decimal number (00 – 99)\n"
+ " %Y Year with century, as decimal number\n"
+ " %z, %Z Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown\n"
+ " %% Percent sign\n"
+ ;
+ return 1;
+ }
+
+ string format = argv[1];
+ time_t t = time(0);
+ tm * tod = localtime(&t);
+ if (!tod)
+ {
+ cerr << "error: localtime function failed\n";
+ return 1;
+ }
+ char* s = new char [format.size() + 256];
+ if (strftime( s, format.size() + 256, format.c_str(), tod ) == 0 )
+ {
+ cerr << "error: buffer overflow\n";
+ return 1;
+ }
+ return 0;
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk