mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-10 16:20:42 +00:00
Add NSDateInterval.[hm] files.
This commit is contained in:
parent
a46edf3643
commit
b1c868bbcb
6 changed files with 269 additions and 0 deletions
|
@ -55,6 +55,7 @@
|
|||
#import <Foundation/NSConnection.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDateFormatter.h>
|
||||
#import <Foundation/NSDateInterval.h>
|
||||
#import <Foundation/NSDate.h>
|
||||
#import <Foundation/NSDecimalNumber.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
|
|
81
Headers/Foundation/NSDateInterval.h
Normal file
81
Headers/Foundation/NSDateInterval.h
Normal file
|
@ -0,0 +1,81 @@
|
|||
|
||||
/* Definition of class NSDateInterval
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
|
||||
By: heron
|
||||
Date: Wed Oct 9 16:24:13 EDT 2019
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
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 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
|
||||
Library 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 Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#ifndef _NSDateInterval_h_GNUSTEP_BASE_INCLUDE
|
||||
#define _NSDateInterval_h_GNUSTEP_BASE_INCLUDE
|
||||
|
||||
#include <Foundation/NSObject.h>
|
||||
#include <Foundation/NSDate.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_12, GS_API_LATEST)
|
||||
|
||||
@interface NSDateInterval : NSObject <NSCoding, NSCopying>
|
||||
|
||||
// Init
|
||||
- (instancetype) init;
|
||||
|
||||
- (instancetype) initWithStartDate: (NSDate *)startDate
|
||||
duration: (NSTimeInterval)duration;
|
||||
|
||||
- (instancetype) initWithStartDate: (NSDate *)startDate
|
||||
endDate: (NSDate *)endDate;
|
||||
|
||||
// Access
|
||||
- (NSDate *) startDate;
|
||||
- (void) setStartDate: (NSDate *)startDate;
|
||||
|
||||
- (NSDate *) endDate;
|
||||
- (void) setEndDate: (NSDate *)endDate;
|
||||
|
||||
- (NSTimeInterval)duration;
|
||||
- (void) setDuration: (NSTimeInterval)duration;
|
||||
|
||||
// Compare
|
||||
- (NSComparisonResult) compare: (NSDateInterval *)dateInterval;
|
||||
|
||||
- (BOOL) isEqualToDateInterval: (NSDateInterval *)dateInterval;
|
||||
|
||||
// Determine
|
||||
- (BOOL) intersectsDateInterval: (NSDateInterval *)dateInterval;
|
||||
|
||||
- (NSDateInterval *) intersectionWithDateInterval: (NSDateInterval *)dateInterval;
|
||||
|
||||
// Contain
|
||||
- (BOOL) containsDate: (NSDate *)date;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSDateInterval_h_GNUSTEP_BASE_INCLUDE */
|
||||
|
48
Headers/Foundation/NSDateIntervalFormatter.h
Normal file
48
Headers/Foundation/NSDateIntervalFormatter.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
|
||||
/* Definition of class NSDateIntervalFormatter
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
|
||||
By: heron
|
||||
Date: Wed Oct 9 16:23:55 EDT 2019
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
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 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
|
||||
Library 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 Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#ifndef _NSDateIntervalFormatter_h_GNUSTEP_BASE_INCLUDE
|
||||
#define _NSDateIntervalFormatter_h_GNUSTEP_BASE_INCLUDE
|
||||
|
||||
#include <Foundation/NSFormatter.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
|
||||
|
||||
@interface NSDateIntervalFormatter : NSFormatter
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSDateIntervalFormatter_h_GNUSTEP_BASE_INCLUDE */
|
||||
|
|
@ -213,6 +213,7 @@ NSConnection.m \
|
|||
NSData.m \
|
||||
NSDate.m \
|
||||
NSDateFormatter.m \
|
||||
NSDateInterval.m \
|
||||
NSDebug.m \
|
||||
NSDecimal.m \
|
||||
NSDecimalNumber.m \
|
||||
|
@ -407,6 +408,7 @@ NSCompoundPredicate.h \
|
|||
NSConnection.h \
|
||||
NSData.h \
|
||||
NSDateFormatter.h \
|
||||
NSDateInterval.h \
|
||||
NSDate.h \
|
||||
NSDebug.h \
|
||||
NSDecimal.h \
|
||||
|
|
106
Source/NSDateInterval.m
Normal file
106
Source/NSDateInterval.m
Normal file
|
@ -0,0 +1,106 @@
|
|||
|
||||
/* Implementation of class NSDateInterval
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
|
||||
By: heron
|
||||
Date: Wed Oct 9 16:24:13 EDT 2019
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
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 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
|
||||
Library 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 Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSDateInterval.h>
|
||||
|
||||
@implementation NSDateInterval
|
||||
|
||||
// Init
|
||||
- (instancetype)init
|
||||
{
|
||||
}
|
||||
|
||||
- (instancetype)initWithStartDate:(NSDate *)startDate
|
||||
duration:(NSTimeInterval)duration
|
||||
{
|
||||
}
|
||||
|
||||
- (instancetype)initWithStartDate:(NSDate *)startDate
|
||||
endDate:(NSDate *)endDate
|
||||
{
|
||||
}
|
||||
|
||||
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone *)zone
|
||||
{
|
||||
}
|
||||
|
||||
// Access
|
||||
- (NSDate *) startDate
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setStartDate: (NSDate *)startDate
|
||||
{
|
||||
}
|
||||
|
||||
- (NSDate *) endDate
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setEndDate: (NSDate *)endDate
|
||||
{
|
||||
}
|
||||
|
||||
- (NSTimeInterval) duration
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setDuration: (NSTimeInterval)duration
|
||||
{
|
||||
}
|
||||
|
||||
// Compare
|
||||
- (NSComparisonResult) compare: (NSDateInterval *)dateInterval
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL) isEqualToDateInterval: (NSDateInterval *)dateInterval
|
||||
{
|
||||
}
|
||||
|
||||
// Determine
|
||||
- (BOOL) intersectsDateInterval: (NSDateInterval *)dateInterval
|
||||
{
|
||||
}
|
||||
|
||||
- (NSDateInterval *) intersectionWithDateInterval: (NSDateInterval *)dateInterval
|
||||
{
|
||||
}
|
||||
|
||||
// Contain
|
||||
- (BOOL) containsDate: (NSDate *)date
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
|
31
Source/NSDateIntervalFormatter.m
Normal file
31
Source/NSDateIntervalFormatter.m
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
/* Implementation of class NSDateIntervalFormatter
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
|
||||
By: heron
|
||||
Date: Wed Oct 9 16:23:55 EDT 2019
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
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 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
|
||||
Library 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 Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSDateIntervalFormatter.h>
|
||||
|
||||
@implementation NSDateIntervalFormatter
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in a new issue